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

dropdown button with width="full" wider than containing block #5903

Closed
AdelheidF opened this issue Dec 5, 2022 · 28 comments
Closed

dropdown button with width="full" wider than containing block #5903

AdelheidF opened this issue Dec 5, 2022 · 28 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. breaking change Issues and pull requests with code changes that are not backwards compatible. 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. p - medium Issue is non core or affecting less that 60% of people using the library

Comments

@AdelheidF
Copy link

AdelheidF commented Dec 5, 2022

Actual Behavior

image

The dropdown button is wider than its containing block if the button text has no dashes or spaces.
Button uses width="full".

Expected Behavior

text is wrapped

Reproduction Sample

https://codepen.io/afreitag/pen/GRGPdwQ

Reproduction Steps

open codepen and observe. Red box displays block dimensions.

Reproduction Version

next.657

Relevant Info

No response

Regression?

Don't think so

Impact

No response

Esri team

ArcGIS Map Viewer

@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 Dec 5, 2022
@github-actions github-actions bot added the ArcGIS Map Viewer Issues logged by ArcGIS Map Viewer team members. label Dec 5, 2022
@geospatialem
Copy link
Member

Applicable in the case mentioned above where text has no breaks, such as "BirdObservationCommentBirdObservationComment" and where "_" characters are present, such as "Bird_Observation_Comment_Bird_Observation_Comment".

image

@AdelheidF
Copy link
Author

AdelheidF commented Dec 8, 2022

Could this be part of 1.0?

@benelan
Copy link
Member

benelan commented Dec 8, 2022

How smart do you want this to be; are you expecting it to understand word breaks such as, capitalization, underscores, periods, etc.

BirdObservationCommentBirdObservation
Comment

Or just wrap on the overflow

BirdObservationCommentBirdObservationCom
ment

@AdelheidF
Copy link
Author

Or just wrap on the overflow

I think this is fine. Don't you do this already in other places like this?

@benelan
Copy link
Member

benelan commented Dec 8, 2022

I believe so. Although interestingly, it currently understands hyphens as word breaks and wraps there.

@macandcheese
Copy link
Contributor

FWIW, it breaks in a different way when the button is not the dropdown-trigger:
Screen Shot 2022-12-08 at 1 32 07 PM

@geospatialem
Copy link
Member

@AdelheidF We're putting this in a list for Franco when he returns, but due to staffing, this one might land in time for the February release. Will post an update a few weeks into 2023.

@geospatialem geospatialem added the design Issues that need design consultation prior to development. label Feb 27, 2023
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Feb 28, 2023
@geospatialem
Copy link
Member

Seeking design expertise for the dropdown button, if wrapping and/or truncating the text should be considered.

@geospatialem geospatialem added enhancement Issues tied to a new feature or request. and removed bug Bug reports for broken functionality. Issues should include a reproduction of the bug. design Issues that need design consultation prior to development. labels Mar 20, 2023
@brittneytewks brittneytewks added p - medium Issue is non core or affecting less that 60% of people using the library estimate - 3 A day or two of work, likely requires updates to tests. labels Mar 21, 2023
@jcfranco jcfranco added breaking change Issues and pull requests with code changes that are not backwards compatible. 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. future breaking change Issues and pull requests with deprecation(s), requires a breaking change in a future milestone. labels Nov 16, 2023
jcfranco added a commit that referenced this issue Nov 23, 2023
…up (#8253)

**Related Issue:** #5903

## Summary

BREAKING CHANGE: Dropdown's default `display` was changed from
`inline-flex` to `inline-block` to make it easier to prompt truncation
in trigger button text with minimal impact to layout (by setting an
explicit width **or** setting `width: 100%` or `display: block` on the
dropdown of a width-constrained parent).
@jcfranco
Copy link
Member

Installed an update to dropdown on rc that will make it easier to set up truncation in the original use case. You'll need to set 100% width in the dropdown or change its display to block as @Elijbet's suggestion shows. We can't do this reliably for all configurations since it really depends on the way the HTML/CSS is structured. For example, this shows the same issue can be seen with block + button.

@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Nov 23, 2023
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned jcfranco Nov 23, 2023
Copy link
Contributor

Installed and assigned for verification.

benelan pushed a commit that referenced this issue Nov 23, 2023
…up (#8253)

**Related Issue:** #5903

## Summary

BREAKING CHANGE: Dropdown's default `display` was changed from
`inline-flex` to `inline-block` to make it easier to prompt truncation
in trigger button text with minimal impact to layout (by setting an
explicit width **or** setting `width: 100%` or `display: block` on the
dropdown of a width-constrained parent).
benelan pushed a commit that referenced this issue Nov 29, 2023
…up (#8253)

**Related Issue:** #5903

## Summary

BREAKING CHANGE: Dropdown's default `display` was changed from
`inline-flex` to `inline-block` to make it easier to prompt truncation
in trigger button text with minimal impact to layout (by setting an
explicit width **or** setting `width: 100%` or `display: block` on the
dropdown of a width-constrained parent).
@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 1, 2023
@geospatialem
Copy link
Member

Verified with v2.0.0-rc.2 when calcite-dropdown's width is set to 100% per Franco's comment above.

image

benelan pushed a commit that referenced this issue Dec 1, 2023
…up (#8253)

**Related Issue:** #5903

## Summary

BREAKING CHANGE: Dropdown's default `display` was changed from
`inline-flex` to `inline-block` to make it easier to prompt truncation
in trigger button text with minimal impact to layout (by setting an
explicit width **or** setting `width: 100%` or `display: block` on the
dropdown of a width-constrained parent).
benelan pushed a commit that referenced this issue Dec 1, 2023
…up (#8253)

**Related Issue:** #5903

## Summary

BREAKING CHANGE: Dropdown's default `display` was changed from
`inline-flex` to `inline-block` to make it easier to prompt truncation
in trigger button text with minimal impact to layout (by setting an
explicit width **or** setting `width: 100%` or `display: block` on the
dropdown of a width-constrained parent).
benelan pushed a commit that referenced this issue Dec 2, 2023
…up (#8253)

**Related Issue:** #5903

## Summary

BREAKING CHANGE: Dropdown's default `display` was changed from
`inline-flex` to `inline-block` to make it easier to prompt truncation
in trigger button text with minimal impact to layout (by setting an
explicit width **or** setting `width: 100%` or `display: block` on the
dropdown of a width-constrained parent).
@AdelheidF
Copy link
Author

AdelheidF commented Dec 8, 2023

I tested this fix now with the original (simple) codepen and it seems fixed with 2.0. But when I look at it in Map Viewer it's still not working.

I updated the codepen to display the issue in the right-side flow. It seems that if the calcite-blocks are surrounded by calcite-sortable-list it's still not working. If you comment out this element it displays correctly.

https://codepen.io/afreitag/pen/GRGPdwQ;

This workaround no longer works either

calcite-dropdown {
  display: block;
}

@AdelheidF AdelheidF reopened this Dec 8, 2023
@jcfranco
Copy link
Member

jcfranco commented Dec 8, 2023

If you set calcite-sortable-list's display to block, it'll work.

Screenshot 2023-12-08 at 2 11 54 PM

@AdelheidF
Copy link
Author

Nice, this works. I will use that.

Is this a workaround or the solution? Basically do you want me to close this issue again?

@jcfranco
Copy link
Member

jcfranco commented Dec 9, 2023

This would be the solution. The recent change to dropdown makes truncation easier to set up, but we can't handle all cases as it depends on the HTML structure.

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 Map Viewer Issues logged by ArcGIS Map Viewer team members. breaking change Issues and pull requests with code changes that are not backwards compatible. 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. p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests