Skip to content

Conversation

@ntacheva
Copy link
Contributor

No description provided.

@ntacheva ntacheva requested a review from marin-bratanov March 25, 2021 11:07

While A and P might be very common symbols, there are many other symbols that might be used in different countries and cultures. Thus, the component cannot track all such possible combinations, and it exposes the Up and Down Arrows as options to change the time segments, including the AM/PM indicator.

In order to change AM/PM by pressing A or P on keyboard you can get the input events such as keydown. They are not built-in in the component, because exposing so many events like that will be a major performance hit for a small percentage of people who need them. However, you can capture them as they bubble up the DOM in a parent element, as described in this article - [Capture input keyboard events]({%slug inputs-kb-handle-keyboard-events%}).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the actual reason is that there can be many different abbreviations, and the component can't know them all. Moreover, the user might expect one or the other (.e.g, if their langauge uses C and D they may still want A and P). We already handle the keydown, but we can't listen for a particular symbol

@ntacheva ntacheva requested a review from marin-bratanov March 26, 2021 17:38
@ntacheva ntacheva merged commit 6f5730f into master Mar 29, 2021
@ntacheva ntacheva deleted the kb-select-am-pm-on-keypress branch March 29, 2021 09:09
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

Successfully merging this pull request may close these issues.

3 participants