Commit c92feaa 1 parent 2dbc38c commit c92feaa Copy full SHA for c92feaa
File tree 3 files changed +7
-1
lines changed
@headlessui-react/src/components/popover
@headlessui-vue/src/components/popover
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
29
29
- Add ` multi ` value support for Listbox & Combobox ([ #1243 ] ( https://github.com/tailwindlabs/headlessui/pull/1243 ) )
30
30
- Improve Combobox Input value ([ #1248 ] ( https://github.com/tailwindlabs/headlessui/pull/1248 ) )
31
31
- Fix Tree-shaking support ([ #1247 ] ( https://github.com/tailwindlabs/headlessui/pull/1247 ) )
32
+ - Stop propagation on the Popover Button ([ #1263 ] ( https://github.com/tailwindlabs/headlessui/pull/1263 ) )
32
33
33
34
### Added
34
35
@@ -60,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
60
61
- Add ` multi ` value support for Listbox & Combobox ([ #1243 ] ( https://github.com/tailwindlabs/headlessui/pull/1243 ) )
61
62
- Improve Combobox Input value ([ #1248 ] ( https://github.com/tailwindlabs/headlessui/pull/1248 ) )
62
63
- Fix Tree-shaking support ([ #1247 ] ( https://github.com/tailwindlabs/headlessui/pull/1247 ) )
64
+ - Stop propagation on the Popover Button ([ #1263 ] ( https://github.com/tailwindlabs/headlessui/pull/1263 ) )
63
65
64
66
### Added
65
67
Original file line number Diff line number Diff line change @@ -461,6 +461,8 @@ let Button = forwardRefWithAs(function Button<TTag extends ElementType = typeof
461
461
dispatch ( { type : ActionTypes . ClosePopover } )
462
462
state . button ?. focus ( ) // Re-focus the original opening Button
463
463
} else {
464
+ event . preventDefault ( )
465
+ event . stopPropagation ( )
464
466
if ( state . popoverState === PopoverStates . Closed ) closeOthers ?.( state . buttonId )
465
467
state . button ?. focus ( )
466
468
dispatch ( { type : ActionTypes . TogglePopover } )
Original file line number Diff line number Diff line change @@ -363,12 +363,14 @@ export let PopoverButton = defineComponent({
363
363
}
364
364
}
365
365
366
- function handleClick ( ) {
366
+ function handleClick ( event : MouseEvent ) {
367
367
if ( props . disabled ) return
368
368
if ( isWithinPanel ) {
369
369
api . closePopover ( )
370
370
dom ( api . button ) ?. focus ( ) // Re-focus the original opening Button
371
371
} else {
372
+ event . preventDefault ( )
373
+ event . stopPropagation ( )
372
374
if ( api . popoverState . value === PopoverStates . Closed ) closeOthers ?.( api . buttonId )
373
375
dom ( api . button ) ?. focus ( )
374
376
api . togglePopover ( )
You can’t perform that action at this time.
0 commit comments