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

Calcite Buttons do not behave consistently with HTML Buttons within a CSS Flex container #9025

Open
2 of 6 tasks
gavinr-maps opened this issue Apr 1, 2024 · 3 comments
Open
2 of 6 tasks
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. 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 p - low Issue is non core or affecting less that 10% of people using the library Professional Services - Midwest Delivery Center Issues logged by Professional Services - Midwest Delivery Center team members.

Comments

@gavinr-maps
Copy link

Check existing issues

Actual Behavior

When a calcite button is within a container that has display: flex set, it :

  1. does not get its width set correctly
  2. does not have the text wrap correctly

Here is the demo: https://codepen.io/gavinr/pen/YzMrEpX?editors=1000

Expected Behavior

Calcite buttons should behave similar to plain HTML buttons when within a container that has display: flex set.

Reproduction Sample

https://codepen.io/gavinr/pen/YzMrEpX?editors=1000

Reproduction Steps

  1. open https://codepen.io/gavinr/pen/YzMrEpX?editors=1000
  2. See the top part, shows how HTML buttons work
  3. See the bottom part - same CSS class applied to Calcite buttons but they are not behaving the same way as the top section
    image

Reproduction Version

2.7.0

Relevant Info

Latest Chrome

Regression?

No response

Priority impact

p2 - want for current milestone

Impact

I have created a workaround using JavaScript but it is using .shadowRoot which is not very preferable: https://codepen.io/gavinr/pen/zYXPEPd?editors=0010

Calcite package

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

Esri team

Professional Services - Midwest Delivery Center

@gavinr-maps gavinr-maps 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 Apr 1, 2024
@github-actions github-actions bot added Professional Services - Midwest Delivery Center Issues logged by Professional Services - Midwest Delivery Center 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 Apr 1, 2024
@macandcheese
Copy link
Contributor

macandcheese commented Apr 1, 2024

Because the default / intended behavior here is to truncate and not wrap (added in this issue), this might need to be re-purposed as a request to opt-out of truncation via prop vs. have it by default. Maybe something like truncation-strategy=“truncate(default)/wrap”

It also seems like the truncation behavior doesn’t work in the above scenario OOTB, so adjustments to that behavior can be looked at.

cc @ashetland @SkyeSeitz for design eyes.

Related truncation issues: #6661

@SkyeSeitz
Copy link

Agreed. Support for wrapping on calcite-button should be opt-in only to avoid oversized buttons when possible or mismatched button heights.

@geospatialem geospatialem added enhancement Issues tied to a new feature or request. has workaround Issues have a workaround available in the meantime. labels Apr 2, 2024
@geospatialem geospatialem added p - low Issue is non core or affecting less that 10% of people using the library estimate - 3 A day or two of work, likely requires updates to tests. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed needs triage Planning workflow - pending design/dev review. labels Apr 15, 2024
@ashetland
Copy link
Contributor

It also seems like the truncation behavior doesn’t work in the above scenario OOTB, so adjustments to that behavior can be looked at.

Using the width prop on the buttons also doesn't seem to work in the above example.

@geospatialem geospatialem removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Sep 10, 2024
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. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. 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 p - low Issue is non core or affecting less that 10% of people using the library Professional Services - Midwest Delivery Center Issues logged by Professional Services - Midwest Delivery Center team members.
Projects
None yet
Development

No branches or pull requests

5 participants