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

Adding more alternatives for "value" prop in the TextField component #2492

Closed
KristianKjerstad opened this issue Sep 16, 2022 · 3 comments
Closed
Assignees

Comments

@KristianKjerstad
Copy link

Is your feature request related to a problem? Please describe.
In our project, we use the TextField EDS component to select the number of iterations for an algorithm. This should only be a positive number >= 1. Right now we have to do validation on the backend that the number is >= 1. It would be nice to have this validation directly in the TextField component

Describe the solution you'd like
Adding more options for the value prop in TextField:
For example

  • positiveNumber
  • strictlyPositiveNumber

Describe alternatives you've considered

Alternative: do number validation on the backend
Additional context

@KristianKjerstad KristianKjerstad changed the title Adding more alternatives for "value" in the TextField component Adding more alternatives for "value" prop in the TextField component Sep 16, 2022
@mimarz
Copy link
Contributor

mimarz commented Sep 19, 2022

How about you get access to the input directly? 😁

We currently have a big change internally on streamlining how we handle our inputs coming up! #2336 The InputWrapper (as its called now) was made for internal use, but we might expose it publicly or have an easier way of implementing some similar feature like this.

We'll have a look on how validation and such as this might be solved when we land our feet on the InputWrapper

@BirteThornquist
Copy link
Contributor

@oddvernes will check up what the status of this

@oddvernes
Copy link
Collaborator

Front end validation should be handled outside our components, there are a couple examples in the storybook

Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants