Skip to content

Tooltip ESC key press propagation #6292

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

Closed
Anastasiia-Boleiko opened this issue Jan 16, 2023 · 8 comments
Closed

Tooltip ESC key press propagation #6292

Anastasiia-Boleiko opened this issue Jan 16, 2023 · 8 comments
Assignees
Labels
4 - verified Issues that have been tested, confirmed as mitigated, and are ready to close. a11y Issues related to Accessibility fixes or improvements. ArcGIS Urban Issues logged by ArcGIS Urban team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@Anastasiia-Boleiko
Copy link

Summary

Calcite tooltip is dismissable that complies with Success Criterion 1.4.13 Content on Hover or Focus (Level AA)

But when pressing the 'Esc' key in an opened calcite-tooltip, that is located in a calcite-modal, the whole modal is closed.
The expected behavior is to only close the tooltip and close the Dialog on the next 'ESC' key press.

Generally speaking, it would be nice to close a context element at the moment (with the Esc key).

Actual Behavior

After pressing 'Esc' key to close a tooltip, the whole dialog gets closed.

Expected Behavior

After pressing 'Esc' key - close the tooltip, and close the Dialog on the next 'ESC' key press.

Reproduction Sample

https://codepen.io/anastasiia-zrh/pen/bGjrZYX

Reproduction Steps

  1. Click 'Open Modal' button
  2. Press 'Esc'

One more example, where it would be nice to close a contextual element (with the Esc key), following visual order:
https://codepen.io/anastasiia-zrh/pen/MWBvZdB

Reproduction Version

1.0.0-beta.97

Working W3C Example/Tutorial

No response

Relevant Info

A similar issue was found in our product by LevelAccess (so we tried calcite components first and found a similar issue):

Ensure that content that appears on hover or focus may be dismissed by the user

Violation:
Ensure that content that appears on hover or focus may be dismissed by the user.
Description:
Examples include:
Tooltips
In this case, pressing the Esc key does close the tooltip, but it also closes the entire dialog.
User Impact
Users may press the Esc key to close the tooltip and may unwittingly and unexpectedly close the entire dialog.

Regression?

No response

Esri team

ArcGIS Urban

@Anastasiia-Boleiko Anastasiia-Boleiko added 0 - new New issues that need assignment. a11y Issues related to Accessibility fixes or improvements. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. p - high Issue should be addressed in the current milestone, impacts component or core functionality labels Jan 16, 2023
@github-actions github-actions bot added the ArcGIS Urban Issues logged by ArcGIS Urban team members. label Jan 16, 2023
@jcfranco jcfranco removed the needs triage Planning workflow - pending design/dev review. label Jan 25, 2023
@jcfranco jcfranco self-assigned this Jan 25, 2023
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Jan 25, 2023
jcfranco added a commit that referenced this issue Feb 8, 2023
…en dismissing a tooltip with Esc (#6343)

**Related Issue:** #6292

## Summary

This updates tooltip manager to cancel the Esc key press if handled to
prevent closing parent components that also close with Esc.

Additionally, extracts a utility to get the tooltip's effective
reference element.
@jcfranco jcfranco added 3 - installed Issues that have been merged to the "dev" branch and/or are ready for QA/QC. and removed 2 - in development Issues that are actively being worked on. labels Feb 8, 2023
@github-actions github-actions bot assigned geospatialem and unassigned jcfranco Feb 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been tested, confirmed as mitigated, and are ready to close. and removed 3 - installed Issues that have been merged to the "dev" branch and/or are ready for QA/QC. labels Feb 9, 2023
@geospatialem
Copy link
Member

Verified with https://codepen.io/anastasiia-zrh/pen/bGjrZYX in 1.0.5.

verify-tooltip-esc-dismiss

Does not include the https://codepen.io/anastasiia-zrh/pen/MWBvZdB sample. @jcfranco, should we open a new issue to close a contextual element (with the Esc key), following visual order?

@Anastasiia-Boleiko
Copy link
Author

Thank you for the update!

Recently, I've checked the link:

Does not include the https://codepen.io/anastasiia-zrh/pen/MWBvZdB sample.

And realized that the behavior has changed (scrolls appear when tooltip is visible), please see the recordings below:
Chrome Version 110.0.5481.77 (Official Build) (arm64)

Chrome

Safari Version 16.0 (17614.1.25.9.10, 17614)

Safari

Ther similar behavior is in v1.0.3 https://codepen.io/anastasiia-zrh/pen/RwBzVeJ?editors=100:
When the tooltip is visible (on the recording I scrolled down to it using keyboard arrows) and pressed Esc, the modal was closed.
Chrome Calcite v1 0 3

Please, let me know if any additional info is needed.

@geospatialem
Copy link
Member

And realized that the behavior has changed (scrolls appear when tooltip is visible), please see the recordings below:
Chrome Version 110.0.5481.77 (Official Build) (arm64)

@Anastasiia-Boleiko Ah, yes, forgot to mention I added the overlay-positioning attribute with a value of "fixed" to the original Codepen so the tooltip displays.

The attribute is needed to display when used within parent components, to ensure proper placement.

For instance:

    <calcite-tooltip label="Example label" overlay-positioning="fixed" reference-element="tooltip-button3" close-on-click>

@Anastasiia-Boleiko
Copy link
Author

@geospatialem Thank you very much! Now the tooltip has a proper placement👍

Could you please suggest if you can reproduce the same behavior:

But when pressing the 'Esc' key in an opened calcite-tooltip, that is located in a calcite-modal, the whole modal is closed.

I've reproduced it in v1.0.3: https://codepen.io/anastasiia-zrh/pen/JjBQrER
Tooltip with overlay-positioning

@geospatialem
Copy link
Member

I've reproduced it in v1.0.3: https://codepen.io/anastasiia-zrh/pen/JjBQrER

Yes, it would be present in 1.0.3 - the fix was mitigated in last night's patch, 1.0.5: https://codepen.io/geospatialem/pen/LYBKOeg

@Anastasiia-Boleiko
Copy link
Author

Oh, got it! I do apologize for the misunderstanding.
Thank you all very much! 👍

@geospatialem
Copy link
Member

No worries! Was waiting to close this out to address the nice to have - just added a new issue and CC'ed you on it to follow along the progress. Thanks for the great feedback to continuously improve CC!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been tested, confirmed as mitigated, and are ready to close. a11y Issues related to Accessibility fixes or improvements. ArcGIS Urban Issues logged by ArcGIS Urban team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

3 participants