Skip to content

Commit

Permalink
Add workaround for Safari action menu focusout
Browse files Browse the repository at this point in the history
  • Loading branch information
yscik committed Jul 22, 2024
1 parent ea40602 commit 8181fa9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion includes/ui/class-ui-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ public static function actions( array $buttons = [], array $links = [] ) {
*/
public static function actions_menu( $content ) {
$label = __( 'Actions', 'wp-job-manager' );

$close = esc_attr( 'event.currentTarget.contains(event.relatedTarget) || setTimeout(() => this.open = false, 100 )' );

return <<<HTML
<details class="jm-ui-actions-menu" onfocusout="event.currentTarget.contains(event.relatedTarget) || ( this.open = false )">
<details class="jm-ui-actions-menu" onfocusout="{$close}">
<summary tabindex="0" class="jm-ui-action-menu__open-button jm-ui-button--icon"
aria-label="{$label}">
<span class="jm-ui-button__icon"></span>
Expand Down

0 comments on commit 8181fa9

Please sign in to comment.