Skip to content

Commit

Permalink
[@mantine/spotlight] Fix closeOnTrigger with not working correctly wi…
Browse files Browse the repository at this point in the history
…th 'Enter' key (#2066)

* [@mantine/spotlight] Fix closeOnTrigger with 'Enter'

* Add parentheses when mixing ?? and &&
  • Loading branch information
morvud committed Aug 12, 2022
1 parent e449ac2 commit ce59be4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mantine-spotlight/src/Spotlight/Spotlight.tsx
Expand Up @@ -191,7 +191,7 @@ export function Spotlight({
event.preventDefault();
const action = groupedActions[hovered];
action?.onTrigger?.(action);
if (closeOnActionTrigger && action?.onTrigger) {
if ((action?.closeOnTrigger ?? closeOnActionTrigger) && action?.onTrigger) {
handleClose();
}
break;
Expand Down

0 comments on commit ce59be4

Please sign in to comment.