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: Set default width for components #1988
Conversation
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.
Thanks @marek-mihok.
Can the overall pattern be improved? Instead of setting the default width and overriding it with minWidth: 100%
, it would be better to only set the fixed default width when needed (inside ui.inline) and expand to the full width otherwise (not within ui.inline). Applies to all plots and table.
The current solution does it the other way around - applies default fixed width first and then sets min width to 100% to see if it helps.
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.
Thanks @marek-mihok. Needs some improvements and is good to go.
e598cca
to
e973ca8
Compare
e973ca8
to
b46e33e
Compare
The width of the following components was affected when used with
ui.inline
:ui.dropdown
ui.date_picker
ui.plot
ui.vega
ui.table
ui.slider
ui.range slider
ui.toggle
Screen.Recording.2023-05-25.at.14.02.11.mov
By default each of these elements either stretches to the width of its parent or the width can be explicitly specified through the
width
prop. The problem is when the parent has no defined width, in our case when placed insideui.inline
.This PR sets the default width for each of these components in case parent width is not defined.
Screen.Recording.2023-05-25.at.14.03.02.mov
I also include the example used in recordings:
Closes #1974