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

UX inconsistency: allowInputToggle does not open picker on tab-navigation focus as well #2575

Closed
lukasjuhrich opened this issue May 25, 2022 · 6 comments

Comments

@lukasjuhrich
Copy link
Contributor

I installed v6.0.0b7.
The relevant stackblitz is here (@master).

tl;dr: If a website teaches me that a click opens the picker, my mind remembers this as “focusing the input field opens the picker”, but focusing via tab-navigation does not do that. This is unexpected.


Not clear whether UX bug (inconsistency) or feature request, but my reasoning is as follows.

The allowInputToggle: true option actually teaches the user not one, but two pieces of functionality:

  1. Clicking on the input field (as well as the icon) reveals the picker
  2. Clicking on the input field once more closes the picker again.

However, for input fields, while the specific action of a user might be a click, the intention behind that is to enter some data, i.e. we're actually trying to focus the element. Note that this is in contrast to other elements (such as links / buttons), where the intention often rather is to trigger an action.

Regarding feature 2, this is somewhat separate, and may potentially not even be discovered by some people, for instance if they are used to clicking anywhere else on the page or pressing escape.
So the fact that this actually is a toggle is more of an implementation detail than a defining feature of this option.

…Back to feature 1. If our intent is to focus the element, we might as well do this with a tab navigation. More precisely, my internal workflow when using forms is this:

  • I click the input field if it is the first input field
  • I press tab if it is the successor to the input field I last edited.

These are two sides of the same coin, so IMO opening the picker in one case and not the other is unexpected behavior.

@Eonasdan
Copy link
Owner

Eonasdan commented Jul 1, 2022

the option name is allowInputToggle. I guess it makes more sense if I rename it to allowInputOpen and just make it open on click. I could add an event trigger when the input field is focused to do the same.

@thenatsky
Copy link

Tabbing to a field is quite a usual user behaviour, especially when there a fair number of fields.

The behaviour that I think would be good to have is that if the user tabs to the input (or any focus mechanism really), then the picker opens if it's not already open and closes if both the input and the picker lose focus.

@donv
Copy link

donv commented May 19, 2023

This issue also arises when using client side validation. The browser will put focus on a required date field, and the date picker should open for that field.

@Eonasdan Eonasdan moved this from 🆕 New to 🔖 Ready in Tempus Dominus May 23, 2023
Eonasdan added a commit that referenced this issue May 24, 2023
@Eonasdan
Copy link
Owner

Hello, please check this StackBlitz

@Eonasdan Eonasdan moved this from 🔖 Ready to 👀 In review in Tempus Dominus May 24, 2023
Eonasdan added a commit that referenced this issue Jul 3, 2023
* #2575 open on focus

* Add type attribute to meridiem button (#2822)

Resolves #2820

* repl improvements

* repl improvements

* Fix typo in Finnish locale (fi.ts) (#2824)

Renamed Edelline -> Edellinen

* repl improvements

* repl improvements

* repl improvements

* repl improvements

---------

Co-authored-by: axunonb <[email protected]>
Co-authored-by: Pertti Roitto <[email protected]>
Eonasdan added a commit that referenced this issue Jul 3, 2023
* #2575 open on focus

* Add type attribute to meridiem button (#2822)

Resolves #2820

* repl improvements

* repl improvements

* Fix typo in Finnish locale (fi.ts) (#2824)

Renamed Edelline -> Edellinen

* repl improvements

* repl improvements

* repl improvements

* repl improvements

---------

Co-authored-by: axunonb <[email protected]>
Co-authored-by: Pertti Roitto <[email protected]>
Eonasdan added a commit that referenced this issue Jul 3, 2023
* #2791 more tests

* #2791 more tests

* #2791 more tests

* #2757 should fix start of the week (#2818)

* Add type attribute to meridiem button (#2822)

Resolves #2820

* repl improvements

* repl improvements

* Fix typo in Finnish locale (fi.ts) (#2824)

Renamed Edelline -> Edellinen

* #2575 open on focus (#2832)

* #2575 open on focus

* Add type attribute to meridiem button (#2822)

Resolves #2820

* repl improvements

* repl improvements

* Fix typo in Finnish locale (fi.ts) (#2824)

Renamed Edelline -> Edellinen

* repl improvements

* repl improvements

* repl improvements

* repl improvements

---------

Co-authored-by: axunonb <[email protected]>
Co-authored-by: Pertti Roitto <[email protected]>

* #2621 potential fix (#2833)

---------

Co-authored-by: axunonb <[email protected]>
Co-authored-by: Pertti Roitto <[email protected]>
@Eonasdan Eonasdan moved this from 👀 In review to ✅ Done in Tempus Dominus Jul 3, 2023
Eonasdan added a commit that referenced this issue Jul 3, 2023
* #2575 open on focus

* Add type attribute to meridiem button (#2822)

Resolves #2820

* repl improvements

* repl improvements

* Fix typo in Finnish locale (fi.ts) (#2824)

Renamed Edelline -> Edellinen

* repl improvements

* repl improvements

* repl improvements

* repl improvements

---------

Co-authored-by: axunonb <[email protected]>
Co-authored-by: Pertti Roitto <[email protected]>
Eonasdan added a commit that referenced this issue Jul 3, 2023
* #2791 more tests

* #2791 more tests

* #2791 more tests

* #2757 should fix start of the week (#2818)

* Add type attribute to meridiem button (#2822)

Resolves #2820

* repl improvements

* repl improvements

* Fix typo in Finnish locale (fi.ts) (#2824)

Renamed Edelline -> Edellinen

* #2575 open on focus (#2832)

* #2575 open on focus

* Add type attribute to meridiem button (#2822)

Resolves #2820

* repl improvements

* repl improvements

* Fix typo in Finnish locale (fi.ts) (#2824)

Renamed Edelline -> Edellinen

* repl improvements

* repl improvements

* repl improvements

* repl improvements

---------

Co-authored-by: axunonb <[email protected]>
Co-authored-by: Pertti Roitto <[email protected]>

* #2621 potential fix (#2833)

---------

Co-authored-by: axunonb <[email protected]>
Co-authored-by: Pertti Roitto <[email protected]>
Eonasdan added a commit that referenced this issue Jul 3, 2023
<h2>6.7.10</h2>
      <h3>New</h3>
      <ul>
        <li>Lots more test coverage #2791</li>
      </ul>
      <h3>Bug fixes</h3>
      <ul>
        <li>Hopefully fixed update options bounce. #2621</li>
        <li>Fixed input toggle #2575</li>
        <li>Fixed docs #2810</li>
      </ul>
@Eonasdan Eonasdan moved this from ✅ Done to 🚀 Released in Tempus Dominus Jul 3, 2023
@Eonasdan
Copy link
Owner

Eonasdan commented Jul 3, 2023

This has been released

@Eonasdan Eonasdan closed this as completed Jul 3, 2023
@github-project-automation github-project-automation bot moved this from 🚀 Released to ✅ Done in Tempus Dominus Jul 3, 2023
@Antal1609
Copy link

This PR seems to break the allowInputToggle.

The picker only opens on every second click on the input field.

Please check this StackBlitz.

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

No branches or pull requests

5 participants