Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Prevent showing file explorer on pressing enter
Browse files Browse the repository at this point in the history
  • Loading branch information
Saliou Diallo committed Aug 10, 2022
1 parent 51e38d6 commit e82f11b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ const ImageSelectionButton = ({
if (onOpenPopup) onOpenPopup()
}

const handleClick = () => {
const handleClick = (e) => {
// if it's a keyboard event, the event detail is 0
// ignore the default click event in that case
// note that trying "e instanceof KeyboardEvent" did not work here
if (e.detail === 0) {
e.preventDefault()
}
if (!showModal) {
onClick()
openModal()
Expand Down

0 comments on commit e82f11b

Please sign in to comment.