-
Notifications
You must be signed in to change notification settings - Fork 315
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
Fix/tombo/responsive list issues #173
Conversation
menuButtonProps | ||
}, | ||
ref | ||
) => { | ||
const componentRef = useRef(null); | ||
const mergedRef = useMergeRefs({ refs: [ref, componentRef] }); | ||
const index = useElementsOverflowingIndex({ ref: componentRef, children, paddingSize, resizeDebounceTime }); | ||
const index = useElementsOverflowingIndex({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I saw we're the only one using ResponsiveList and useElementsOverflowingIndex
so there's no risk of breaking changes right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is open source, so it not known, but this is still a work in progress, i don't mind changing it
} | ||
|
||
|
||
export const ChangeChildrenCheck = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the fix, this story is broken.
If you prefer another solution and want to reproduce the bug,
you can copy the stories file here and open this story.
menuButtonProps | ||
}, | ||
ref | ||
) => { | ||
const componentRef = useRef(null); | ||
const mergedRef = useMergeRefs({ refs: [ref, componentRef] }); | ||
const index = useElementsOverflowingIndex({ ref: componentRef, children, paddingSize, resizeDebounceTime }); | ||
const index = useElementsOverflowingIndex({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is open source, so it not known, but this is still a work in progress, i don't mind changing it
There were a few issues with the ResponsiveList we found, that caused it to break sometime and draw too much items.
It didn't draw items that it didn't have place for, so after it calculated their width once,
it wouldn't be able to calculate it again.
since the children here would include only part of the children
If there were new items added after drawing it, it wouldn't be able to calculate the widthes for the same reason and it'll break
To solve it, I'm drawing it twice now, once for calculation only invisibly with position absolute with the parent width,
and once the actual drawing.