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 impacts layout #11378

Closed
2 of 6 tasks
nwhittaker opened this issue Jan 24, 2025 · 5 comments
Closed
2 of 6 tasks

Tooltip impacts layout #11378

nwhittaker opened this issue Jan 24, 2025 · 5 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. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@nwhittaker
Copy link
Contributor

Check existing issues

Actual Behavior

The <calcite-tooltip> element itself is treated as a component with layout that impacts the flow of content. For example, within a flex layout the tooltip takes up a content box:

Image

Expected Behavior

The tooltip element does not have an impact on layout.

Image

Reproduction Sample

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

Reproduction Steps

  1. Visit the sample and possibly wait awhile for the unkpg.com resources to load.
  2. Compare the displayed layout with the expected vs. actual layouts.

Reproduction Version

3.0.0-next.111

Relevant Info

Suggested fix is to have the tooltip style its :host with display: contents;.

Regression?

2.13.2

Priority impact

impact - p3 - not time sensitive

Impact

The issue is easy to work around by giving the tooltip contents display externally. However, this issue does represent a backwards compatibility break with how tooltips impacted layout in 2.13.2.

For a specific use case, we have informational icons associated with input labels in a "space-between" flex layout. After upgrading to Calcite 3, the label space is truncated and the icon is positioned in the center of layout instead of aligned with the trailing edge.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Jan 24, 2025
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Jan 24, 2025
@driskull
Copy link
Member

Suggested fix is to have the tooltip style its :host with display: contents;.

I like that suggestion. This would be a breaking change since we're changing the default display from block to contents but it could fall under the breaking changes for 3.0. Thoughts @jcfranco

We should also do this for popover if we do this for tooltip.

@driskull
Copy link
Member

driskull commented Jan 24, 2025

Previously, tooltip host elements were also displayed as block but they were positioned absolute or fixed so they wouldn't take up any space. However, this caused scrollbars in some scenarios.

@jcfranco
Copy link
Member

jcfranco commented Jan 25, 2025

Great suggestion. I think we could include it in 3.0 as part of #10240 since popover and tooltip are considered in layout after it was installed. @geospatialem @brittneytewks

driskull added a commit that referenced this issue Jan 27, 2025
**Related Issue:** #11378

## Summary

- change default display on `tooltip` and `popover` from `block` to
`contents`.


BEGIN_COMMIT_OVERRIDE
omitted from changelog
END_COMMIT_OVERRIDE
@driskull driskull added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 0 - new New issues that need assignment. labels Jan 27, 2025
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added p - high Issue should be addressed in the current milestone, impacts component or core functionality estimate - 2 Small fix or update, may require updates to tests. 4 - verified Issues that have been released and confirmed resolved. and removed needs triage Planning workflow - pending design/dev review. 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Jan 28, 2025
@geospatialem
Copy link
Member

Verified in 3.0.0-next.116:

Image

benelan pushed a commit that referenced this issue Feb 8, 2025
**Related Issue:** #11378

## Summary

- change default display on `tooltip` and `popover` from `block` to
`contents`.


BEGIN_COMMIT_OVERRIDE
omitted from changelog
END_COMMIT_OVERRIDE
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. estimate - 2 Small fix or update, may require updates to tests. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

5 participants