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

Breaks when inside a label tag #48

Open
aleksre opened this issue Apr 7, 2020 · 0 comments
Open

Breaks when inside a label tag #48

aleksre opened this issue Apr 7, 2020 · 0 comments

Comments

@aleksre
Copy link

aleksre commented Apr 7, 2020

When the component is placed inside a <label> tag, it will close and immediately re-open itself when the user selects a date.

There are several good reasons for wrapping a <input> within a <label>. It means you don't have to give the input an id (and a for attribute for the label), but still allows you to get the accessibility benefit of having a label semantically tied to the input. It also allows the user to click on the label itself to shift focus to the input.

Another issue I noticed, is that the input component is not "transparent". In other words, it does not forward native events from the input out to the consumer of the date-pick component. This means that the component will not work with validation frameworks that rely on blur for example.

I have made a codesandbox to illustrate both issues here.

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