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

Slotted block elements in dialog's content-top/content-bottom slots hug content #10140

Open
2 of 6 tasks
nwhittaker opened this issue Aug 21, 2024 · 2 comments
Open
2 of 6 tasks
Assignees
Labels
0 - new New issues that need assignment. 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. calcite-components Issues specific to the @esri/calcite-components package. has workaround Issues have a workaround available in the meantime. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.

Comments

@nwhittaker
Copy link
Contributor

Check existing issues

Actual Behavior

If a block element is slotted into a dialog component's content-top or content-bottom slots, the element loses its block display and hugs its content as if it was an inline element.

Screenshot 2024-08-21 at 6 47 50 PM

Expected Behavior

The slotted block elements maintain their block display.

Screenshot 2024-08-21 at 6 48 32 PM

Reproduction Sample

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

Reproduction Steps

  1. Visit the sample
  2. Use the slotted elements' lightpink background color to judge whether or not they're stretching to fill the width of their container or hugging their content instead.

Reproduction Version

2.11.1

Relevant Info

I would question if it's appropriate/expected for components to be placing <slot> elements within flex layouts. It's not documented, so it leads to unexpected layouts where block elements don't behave like block elements by default.

Additionally, if the user needs a flex layout, they'll likely slot an element with a flex layout anyway since there's no way to fully customize the other flex-related styles on the slot's container.

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

A workaround is to add flex: 1 styles to the slotted elements.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @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 Aug 21, 2024
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Aug 21, 2024
@geospatialem geospatialem added the spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. label Sep 3, 2024
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Sep 3, 2024
@jcfranco jcfranco added the has workaround Issues have a workaround available in the meantime. label Sep 13, 2024
@jcfranco
Copy link
Member

@nwhittaker makes a solid point. Since we don't explicitly document the parent display of slotted content, developers are left guessing, which isn't great for DX.

I believe we use display: flex in several places, but I doubt it's consistent for all slot containers (I could be wrong on this).

We should discuss this further to see what our options are since this is a concern for all components. cc @driskull @macandcheese @geospatialem

@geospatialem
Copy link
Member

geospatialem commented Sep 16, 2024

Spike next steps:

  • Are other design systems using one over the other, or a combination?
  • Determine the use of slots with display (block and flex) across the design system
  • Determine next steps around panel and dialog (and potentially other components that should be tackled sooner as a high priority) and if we can provide a path forward in the short-term
  • Consider for a documentation update based on ☝🏻 above findings

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. 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. calcite-components Issues specific to the @esri/calcite-components package. has workaround Issues have a workaround available in the meantime. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment.
Projects
None yet
Development

No branches or pull requests

3 participants