fix: enable context menu in editable element
This commit is contained in:
parent
02ba04b5d8
commit
4c243638cb
@ -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 }) => ({
|
||||
|
Loading…
Reference in New Issue
Block a user