Firefox: Fix dropdowns not opening with touch (#1923)

Fixes #1921

### Change Type

- [x] `patch` — Bug fix

### Test Plan

1. On firefox...
2. Use a touch device (or devtools)...
3. Try to open a dropdown menu, eg: main menu, styles menu, more tools
menu.
4. Make sure the menu opens correctly.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Firefox: Fixed dropdown menus not opening with touch.
This commit is contained in:
Lu Wilson 2023-09-19 15:58:10 +01:00 committed by GitHub
parent 0e621e3de1
commit db58d9c54f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,13 @@ export function Trigger({
'data-testid'?: string
}) {
return (
<DropdownMenu.Trigger dir="ltr" data-testid={testId} asChild>
<DropdownMenu.Trigger
dir="ltr"
data-testid={testId}
asChild
// Firefox fix: Stop the dropdown immediately closing after touch
onTouchEnd={(e) => preventDefault(e)}
>
{children}
</DropdownMenu.Trigger>
)