Skip to content
Snippets Groups Projects
Unverified Commit 4c243638 authored by GyDi's avatar GyDi
Browse files

fix: enable context menu in editable element

parent 02ba04b5
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,17 @@ const Layout = () => {
}}
onContextMenu={(e) => {
// only prevent it on Windows
if (OS === "windows") e.preventDefault();
const validList = ["input", "textarea"];
const target = e.currentTarget;
if (
OS === "windows" &&
!(
validList.includes(target.tagName.toLowerCase()) ||
target.isContentEditable
)
) {
e.preventDefault();
}
}}
sx={[
({ palette }) => ({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment