streamlit
streamlit copied to clipboard
Use re-resizable for dataframe
๐ Context
Integrate reresizable into the dataframe because safari, firefox, and chrome have different ui's and inconsistencies. Please describe the project or issue background here
-
What kind of change does this PR introduce?
- [x] Bugfix
- [ ] Feature
- [x] Refactoring
- [ ] Other, please describe:
๐ง Description of Changes
Add state so that when we zoom out, we can reset it to the initial state integrate reresizable so that it only has the bottom right resizability and follows the StyledContainer Parent size as a child
-
Add bullet points summarizing your changes here
- [ ] This is a breaking API change
- [x] This is a visible (user-facing) change
Revised:
Insert screenshot of your updated UI/code here
Current:
Insert screenshot of existing UI/code here
๐งช Testing Done
- [ ] Screenshots included
- [x] Added/Updated unit tests
- [ ] Added/Updated e2e tests
๐ References
Does this depend on other work, documents, or tickets?
- Issue: Closes #XXXX
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Hmm, the screenshot in the cypress test looks bit strange
Hmm, the screenshot in the cypress test looks bit strange
@LukasMasuch is it I will work on these later tonight! Let me know if you need it sooner. I also am trying to get the multiselect code nits in.
Update: Found the problem and fixed it.
@willhuang1997 I think you can solve this add_rows
problem also with a layout effect, e.g. (above the fullscreen layout effect):
React.useLayoutEffect(() => {
if (resizableRef.current) {
// Reset the height if the number of rows changes (e.g. via add_rows)
setResizableSize({
width: resizableSize.width,
height: initialHeight,
})
}
}, [numRows])
The solution without layout effect might have some negative side effects.