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

min/max props for sl-input type="date" get truncated #330

Closed
moos opened this issue Feb 11, 2021 · 2 comments
Closed

min/max props for sl-input type="date" get truncated #330

moos opened this issue Feb 11, 2021 · 2 comments
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@moos
Copy link

moos commented Feb 11, 2021

Describe the bug
min/max props for sl-input type="date" get truncated.

To Reproduce
Markup:

<sl-input name="name" type="date" placeholder="Event date"
                 min="2018-01-01" max="2018-12-31"></sl-input>

In shadow DOM we get:

<input part="input" id="input-2" class="input__control" type="date" name="" placeholder="Event date" min="2018" max="2018" aria-labelledby="input-label-2" aria-describedby="input-help-text-2" aria-invalid="false">

Notice that min and max attributes have become "2018", which is useless for the date picker.

Expected behavior
It should preserve the min/max props as they are (or process them according to type prop).

Desktop (please complete the following information):

  • OS: win10
  • Edge latest

Additional context
Add any other context about the problem here.

@moos moos added the bug Things that aren't working right in the library. label Feb 11, 2021
@claviska
Copy link
Member

I've adjusted the min and max types to be number | string to account for dates. I'll push the update soon. Thanks for reporting it!

@moos
Copy link
Author

moos commented Feb 19, 2021

Great -- thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

2 participants