You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is not posible to define the exact gap between items so that at any given point in time the visible items are hidden at the exact time of overflow.
We can only provide a static padding, this results for early overflow when resizing smaller. This is getting more noticable for whenn many items are used with a larger gap.
Eg. 10 items (100px width), gap 20px => padding 200px
Item 2 will be hidden at 399px container width, Even tho it would fit until 220px container width
Example dynamic padding based on visible item count: [Item 1] [Item 2] [Item 3]
General State
Item width: 100px
Gap: 10px
Initial state for Overflow
Overflow Padding: 20px
Container size: 320px
Container Resize
Container size: 319px
Overflow Manager will hide Item 3 because 3 * 100 > 319 - 20 Example is now: [Item 1] [Item 2]
Option 1: In order for the overflow to happen after resizing at 209px the padding needs to be in total 10px.
Option 2: But the padding as well needs to be 20px so that the overflow can happen after resizing to 320px. Otherwise it would already show item 3 at 310px when we would use 10px for padding.
Even if we would use 10px (Option 1, set padding to actual total padding currently in use) this would introduce a flickering as the overflow manager (instances, plural because if the options change a new instance is created) would oscillate between 3 and 2 items:
container size: 319px
padding: 20px
3 * 100 > 319 - 20 => Item 3 hide
Update Padding to 10px
Next instance of overflow manager is created: all items are in visible queue
Hide Until 3 * 100 < 319 - 10 => all are shown
Update Padding to 20px
Next instance of overflow manager is created: all items are in visible queue
Provide a way to either statically define a space between items and padding per item, that is used based on items visible.
Provide a function that is called per item to let the user decide based on id and index what the total padding is.
Is there a better solution to process overflow
Probably, yes, is there any reason why we use width sum instead of reverse iterating and checking x coordinate plus width?
If coordinate would be used, all the css gap would work ootb.
Additional context
No response
Have you discussed this feature with our team
No response
Validations
Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.
Priority
Low
The text was updated successfully, but these errors were encountered:
Hello @mathis-m, currently there's a workaround for a gap in the Overflow component.
You might want to use OverflowDivider as a gap and to style it accordingly.
It's not the best solution, but might help for now.
Here's an example: https://stackblitz.com/edit/um8bvi5k?file=src%2Fexample.tsx
Hello @mathis-m, currently there's a workaround for a gap in the Overflow component.
You might want to use OverflowDivider as a gap and to style it accordingly.
It's not the best solution, but might help for now.
Here's an example: https://stackblitz.com/edit/um8bvi5k?file=src%2Fexample.tsx
Thanks, my workaround is to add padding within the item itself, depending on its index and if overflow button is shown or not.
Area
React Components (@fluentui/react-components)
Describe the feature that you would like added
Currently it is not posible to define the exact gap between items so that at any given point in time the visible items are hidden at the exact time of overflow.
We can only provide a static padding, this results for early overflow when resizing smaller. This is getting more noticable for whenn many items are used with a larger gap.
Eg. 10 items (100px width), gap 20px => padding 200px
Item 2 will be hidden at 399px container width, Even tho it would fit until 220px container width
Example dynamic padding based on visible item count: [Item 1] [Item 2] [Item 3]
General State
Item width: 100px
Gap: 10px
Initial state for Overflow
Overflow Padding: 20px
Container size: 320px
Container Resize
Container size: 319px
Overflow Manager will hide Item 3 because
3 * 100 > 319 - 20
Example is now: [Item 1] [Item 2]
Option 1: In order for the overflow to happen after resizing at 209px the padding needs to be in total 10px.
Option 2: But the padding as well needs to be 20px so that the overflow can happen after resizing to 320px. Otherwise it would already show item 3 at 310px when we would use 10px for padding.
Even if we would use 10px (Option 1, set padding to actual total padding currently in use) this would introduce a flickering as the overflow manager (instances, plural because if the options change a new instance is created) would oscillate between 3 and 2 items:
container size: 319px
padding: 20px
3 * 100 > 319 - 20
=> Item 3 hide3 * 100 < 319 - 10
=> all are shown3 * 100 < 319 - 20
=> Item 3 is hiddenRelated Code for proccesing of items:
fluentui/packages/react-components/priority-overflow/src/overflowManager.ts
Lines 141 to 176 in 5964b11
Re-instantiate of manager
fluentui/packages/react-components/react-overflow/library/src/useOverflowContainer.ts
Lines 71 to 89 in 5964b11
Add all items to visible queue after instantiate
fluentui/packages/react-components/priority-overflow/src/overflowManager.ts
Line 190 in 5964b11
Missing Option from my perspective
Provide a way to either statically define a space between items and padding per item, that is used based on items visible.
Provide a function that is called per item to let the user decide based on id and index what the total padding is.
Is there a better solution to process overflow
Probably, yes, is there any reason why we use width sum instead of reverse iterating and checking x coordinate plus width?
If coordinate would be used, all the css gap would work ootb.
Additional context
No response
Have you discussed this feature with our team
No response
Validations
Priority
Low
The text was updated successfully, but these errors were encountered: