fix: prevent default action when activating "Import Backup" by keyboard
This commit is contained in:
@@ -107,10 +107,9 @@ const DataBackup = observer(({
|
|||||||
if (code !== 'Enter' && code !== 'Space') {
|
if (code !== 'Enter' && code !== 'Space') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// In case "space" is pressed, don't allow scrolling
|
// Don't proceed the event's default action
|
||||||
if (code === 'Space') {
|
// (like scrolling in case the "space" key is pressed)
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(fileInputRef.current as HTMLInputElement).click();
|
(fileInputRef.current as HTMLInputElement).click();
|
||||||
@@ -150,6 +149,7 @@ const DataBackup = observer(({
|
|||||||
<div className="flex">
|
<div className="flex">
|
||||||
<button className="sn-button small info" onClick={downloadDataArchive}>Download Backup</button>
|
<button className="sn-button small info" onClick={downloadDataArchive}>Download Backup</button>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
className="sn-button small flex items-center info ml-2"
|
className="sn-button small flex items-center info ml-2"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onClick={handleImportFile}
|
onClick={handleImportFile}
|
||||||
|
|||||||
Reference in New Issue
Block a user