-
Notifications
You must be signed in to change notification settings - Fork 4k
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
TextArea in Modal triggers Dropdown #4044
Comments
I tried this on the website, I thought it is running 1.2.1? |
Oh, good catch 👍 const DropdownExampleDropdown = () => (
<Dropdown text='File'>
<Dropdown.Menu>
<Modal
onClick={(e) => e.stopPropagation()}
trigger={<Dropdown.Item text='New' />}
>
<TextArea onKeyDown={(e) => e.stopPropagation()}></TextArea>
</Modal>
<Dropdown.Item text='Open...' description='ctrl + o' />
</Dropdown.Menu>
</Dropdown>
) However, in this case it has more sense to use controlled const DropdownExampleDropdown = () => {
const [open, setOpen] = React.useState()
return (
<>
<Dropdown text='File'>
<Dropdown.Menu>
<Dropdown.Item onClick={() => setOpen(true)} text='New' />
<Dropdown.Item text='Open...' description='ctrl + o' />
</Dropdown.Menu>
</Dropdown>
<Modal
onOpen={() => setOpen(true)}
onClose={() => setOpen(false)}
open={open}
>
<TextArea></TextArea>
</Modal>
</>
)
} Please let me know if these scenarios work for you. |
Thank you! The controlled Modal worked (but only if put outside of the Dropdown Menu). Not sure if this issue is closed now :-) |
Nice 👍 So it's partially related to #3716 as to solve it we will need to rework events 🔧 We have there a workaround, closing this as a duplicate. |
I have a TextArea in a Modal that is triggered by a Dropdown.Item. When I select the TextArea and then press Space the menu opens/closes in the back.
Repro: See the edited "Dropdown" example from https://react.semantic-ui.com/modules/dropdown/#types-dropdown
Just press "New", select the TextArea to open the Dropdown in the background (the BUG!).
The text was updated successfully, but these errors were encountered: