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

Refactor input-date-picker connectFocusTrap config options #10899

Open
1 of 5 tasks
Elijbet opened this issue Nov 27, 2024 · 0 comments
Open
1 of 5 tasks

Refactor input-date-picker connectFocusTrap config options #10899

Elijbet opened this issue Nov 27, 2024 · 0 comments
Labels
0 - new New issues that need assignment. calcite-components Issues specific to the @esri/calcite-components package. needs triage Planning workflow - pending design/dev review. refactor Issues tied to code that needs to be significantly reworked.

Comments

@Elijbet
Copy link
Contributor

Elijbet commented Nov 27, 2024

Description

Refactor connectFocusTrap config options to use callbacks to return focus based on whether it was closed via keyboard vs mouse. This change was made to avoid clicking on a separate, external element and having focus jump back to the input-date-picker.

0d9ddc9#diff-4d4cdb442e767292afec664b7753872b8065094a8ddb8c19226d68126e156fa6R906

In the keyboard case, it will always fire on the element vs clicks.

After this refactor when focusTrap is enabled, it will take care of focus to return to text input when date picker is closed with escape. Refactor escape keyDownHandler to only close with escape when focusTrapDisabled is true.

https://github.com/Esri/calcite-design-system/pull/10578/files#diff-42c23e5a429472ae2ecb636c2ba383162681d40c5ff70c3f89be55d376052e32R799

Proposed Advantages

Use of focusTrap util fully as intended and not have redundant component logic.

Which Component

input-date-picker

Relevant Info

No response

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components
@Elijbet Elijbet added refactor Issues tied to code that needs to be significantly reworked. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Nov 27, 2024
@github-actions github-actions bot added the calcite-components Issues specific to the @esri/calcite-components package. label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. calcite-components Issues specific to the @esri/calcite-components package. needs triage Planning workflow - pending design/dev review. refactor Issues tied to code that needs to be significantly reworked.
Projects
None yet
Development

No branches or pull requests

1 participant