-
Notifications
You must be signed in to change notification settings - Fork 127
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: elements min width #755
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.
I still contend the issue is likely to with the automatic size detection, with the specific adjustment that was removed in https://github.com/aragon/aragon-ui/pull/608/files#diff-55232f9d6a5dbb62a16b3f3e556275cbL126-L127 being relevant.
But I think @bpierre will have some thoughts about this as well
@@ -186,7 +178,7 @@ const DropDown = React.memo(function DropDown({ | |||
padding-left: ${2 * GU}px; | |||
padding-right: ${1.5 * GU}px; | |||
width: ${width || (wide ? '100%' : 'auto')}; | |||
min-width: ${wide ? 'auto' : `${placeholderMinWidth}px`}; | |||
min-width: auto; |
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.
I think we need this to be set directly, because using auto
won't automatically adjust for the width of all items.
The original behaviour was intended for the dropdown's width to fit all listed items, even if they were not selected.
@@ -9,8 +9,6 @@ import { useViewport } from '../../providers/Viewport/Viewport' | |||
import ButtonBase from '../ButtonBase/ButtonBase' | |||
import Popover from '../Popover/Popover' | |||
|
|||
const MIN_WIDTH = 128 |
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.
Should we try and use GU
here?
setMeasureWidth(false) | ||
}, []) | ||
useEffect(() => { | ||
setMeasureWidth(true) | ||
}, [vw, items]) | ||
|
||
console.log('measured width ', measureWidth) |
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.
Let's remember to remove this when this is ready to review. 😃
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for contributing to Aragon! 🦅 |
Not sure if this is the desired behavior but opening to start the discussion
Issue : aragon/aragon-apps#1047