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

Bug: calcite-tooltip not working on disabled calcite-tile #3173

Closed
2 tasks
AdelheidF opened this issue Oct 7, 2021 · 6 comments
Closed
2 tasks

Bug: calcite-tooltip not working on disabled calcite-tile #3173

AdelheidF opened this issue Oct 7, 2021 · 6 comments
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. design Issues that need design consultation prior to development. needs triage Planning workflow - pending design/dev review.

Comments

@AdelheidF
Copy link

I want to display a tooltip for a disabled tile to tell the user why this option is not available. But the tooltip doesn't show if a tile is disabled.

Actual Behavior

no tooltip shows

Expected Behavior

tooltip should show

Reproduction Steps and Sample

https://codepen.io/afreitag/pen/VwWoGVV?editors=1000

Relevant Info

Version: @esri/[email protected]

  • CDN
  • NPM package
@AdelheidF AdelheidF added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Oct 7, 2021
@driskull
Copy link
Member

driskull commented Oct 7, 2021

Looks like this is an issue with calcite-tile. It shouldn't be setting pointer-events: none on the host because then any hovering won't work. Instead, it should set the pointer-events none on a container within the host.

Does that make sense @jcfranco ?

@jcfranco
Copy link
Member

jcfranco commented Oct 7, 2021

TL;DR: calcite-tile's only interactive portion is the internal link, so removing the host pointer-events could suffice.

Went on a bit of a rabbit hole. 😅

  1. It looks like disabled is only applicable when the href property is set as it makes the tile interactive
  2. Supporting disabled when non-interactive (w/o href) seems to contradict Epic: consistent disabled prop behavior #2655 (comment), but there wasn't an example of 'partial-disabled' behavior during that time.
  3. In the provided sample, assuming pointer-events:none was set on the internal container, there would still be an issue for keyboard users as the tile w/o href is not tabbable
  4. This isn't really applicable to calcite-tile as it's not a form control, but the spec advises for disabled form controls to prevent click events. There's no details on other events and there's even a thread about this: Mouse events & disabled form controls whatwg/html#2368 I think we could follow this pattern for interactive components too.

@Esri/calcite-design-representatives WDYT about ☝🏼 ?

cc @benelan

@AdelheidF
Copy link
Author

AdelheidF commented Oct 7, 2021

Here is a related issue to allow focus on a tile: #2141

Design:
image

@benelan benelan added the design Issues that need design consultation prior to development. label Oct 8, 2021
@macandcheese
Copy link
Contributor

@jcfranco above sounds good in combination with #2141

@driskull
Copy link
Member

driskull commented Nov 3, 2022

@AdelheidF as a workaround for now, can you add the tooltip to a div that is wrapping the disabled tile?

@AdelheidF
Copy link
Author

Workaround idea works, I'm fine with this.

@macandcheese macandcheese removed their assignment Dec 15, 2022
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. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. design Issues that need design consultation prior to development. needs triage Planning workflow - pending design/dev review.
Projects
None yet
Development

No branches or pull requests

5 participants