-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Heya, props for the lib.
I would like an arrow/chevron to be shown so that it is clearer to the user that the flag is actually a button revealing a dropwdown.
I sketched a solution where the consumer can set a renderIcon prop, which is of shape
(isFlagsMenuOpened: boolean) => React.ReactNode But it would need a little thinking and tweaking on the button styles, because the Icon enlarges the button area, which looks weird depending on the size of the Icon. This is how it looks for a (dummy-)Icon:
const renderIcon: MuiTelInputProps['renderIcon'] = (isFlagsMenuOpened) => {
return (
<div
style={{
paddingLeft: '0.5rem'
}}
>
<div
style={{
transition: `transform 0.1s ease-out`,
transform: `rotate(90deg) scaleX(${isFlagsMenuOpened ? -1 : 1})`
}}
>
<span
style={{
fontSize: '0.8rem'
}}
>
>
</span>
</div>
</div>
)
}@viclafouch Do you see a better way to achieve the desired behavior?
Shall I raise a PR so that the first solution can be discussed?
albertus-andito, Lamecarlate, drod3763, jmachowska, bensonjm and 2 more
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
