Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Textfield component #4

Open
abas1991 opened this issue Feb 29, 2020 · 0 comments
Open

[Feature Request] Textfield component #4

abas1991 opened this issue Feb 29, 2020 · 0 comments

Comments

@abas1991
Copy link

abas1991 commented Feb 29, 2020

Feature Summary

I would like to create a text-field component that has the following features:

  • Specify input type(e.g. text, number, password)

  • Bind events(e.g. onInput,onChange, etc)

  • Set icon to input

  • Specify common input props (e.g. disabled, label , placeholder, class)

  • Ability to change to textarea control

  • set validation state

And it will be used as follows:

<script>
  import { TextField } from "svelte-admin";

  const props = {
   placeholder: "enter first name",
   label: "first name",
   disabled: true,
   valid: true
   /* more */ 
  }
let inputValue = ""
let focused = false
let changeValue = ""
let inputValue = ""
</script>

  <Textfield
    {...props}
    textarea
    bind:value={inputValue}
    on:blur={() => focused = false}
    on:focus={() => focused = true}
    on:change={e => (changeValue = e.target.value)}
    on:input={e => (inputValue = e.target.value)}>
           /* icon element */ 
   </Textfield>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant