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

Tooltip appears above modal overlay #5388

Closed
nwhittaker opened this issue Sep 27, 2022 · 7 comments
Closed

Tooltip appears above modal overlay #5388

nwhittaker opened this issue Sep 27, 2022 · 7 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. has workaround Issues have a workaround available in the meantime.

Comments

@nwhittaker
Copy link
Contributor

Actual Behavior

If a tooltip is visible when a modal appears, the tooltip is layered above the modal's background overlay.

Screen Shot 2022-09-27 at 10 54 09 AM

Expected Behavior

The tooltip is layered below the overlay.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/eYryBbY

Reproduction Steps

  1. Visit the sample
  2. Hover the button until a tooltip appears
  3. Click the button to open the modal

Reproduction Version

beta.94

Relevant Info

Field Maps has many icon-only buttons with tooltips (e.g. delete map, copy map, etc...) that launch modals.

Regression?

No response

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker 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 Sep 27, 2022
@github-actions github-actions bot added the ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. label Sep 27, 2022
@jcfranco
Copy link
Member

This is caused by our predefined z-index layer values where tooltip uses a popup z-index value of 999 and modal and its overlay use 700 and 800, respectively.

As a workaround, you could apply a z-index of 1000 to calcite-modal.

@macandcheese @ashetland @SkyeSeitz @driskull Do we to tweak the z-index used by tooltips (and other floating-ui components) to use the same as modal?

@jcfranco jcfranco added the has workaround Issues have a workaround available in the meantime. label Oct 13, 2022
@driskull
Copy link
Member

Do we to tweak the z-index used by tooltips (and other floating-ui components) to use the same as modal?

That might be the best thing to do. If a tooltip is inside a modal it should still appear above the modal right?

@ashetland
Copy link

That was going to be my question as well, can a tooltip be invoked inside a modal and how would the z-index affect that? One thing I noticed in the example was that I expected the Tooltip to dismiss as soon as the Modal opened. That might be another way to solve this, but I'm not sure about feasibility.

@macandcheese
Copy link
Contributor

Do we to tweak the z-index used by tooltips (and other floating-ui components) to use the same as modal?

That might be the best thing to do. If a tooltip is inside a modal it should still appear above the modal right?

I'd agree yes

@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Oct 18, 2022
@driskull driskull self-assigned this Dec 1, 2022
@driskull driskull added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Dec 1, 2022
@driskull
Copy link
Member

driskull commented Dec 1, 2022

Making the tooltip/popover the same zIndex as the overlay doesn't seem to work because when you put a tooltip inside the modal it wont' display. This is because the modal is positioned fixed.

I think the best solution is to allow a user to set the zIndex of a component using a CSS variable for cases like this.

driskull added a commit that referenced this issue Dec 5, 2022
**Related Issue:** #5388

## Summary

fix(tooltip): Prevent tooltip from appearing above modal overlay. #5388

- Updates floating-ui to use tailwind configuration
- Sets default z-index to be that of a dropdown
- Adds ability for users to customize zindex of tooltips and popovers
  - CSS vars `--calcite-tooltip-z-index` and `--calcite-popover-z-index`

```html
 <calcite-tooltip style="--calcite-tooltip-z-index: 500;" label="Open modal" reference-element="button">
Open modal
</calcite-tooltip>
```
@driskull driskull added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Dec 5, 2022
@github-actions github-actions bot assigned benelan and geospatialem and unassigned driskull Dec 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

Installed and assigned for verification.

@benelan benelan removed their assignment Dec 8, 2022
@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Dec 10, 2022
@geospatialem
Copy link
Member

Verified on next.669 where the tooltip, or popover, can have customized z-index'es using CSS vars --calcite-tooltip-z-index and --calcite-popover-z-index respectively.

For instance:

 <calcite-tooltip style="--calcite-tooltip-z-index: 300;" label="Open modal" reference-element="button">
Open modal</calcite-tooltip>

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 released and confirmed resolved. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. has workaround Issues have a workaround available in the meantime.
Projects
None yet
Development

No branches or pull requests

7 participants