mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:03:45 +08:00
fix: enable context menu in editable element
This commit is contained in:
parent
031a253101
commit
3748e420a0
@ -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…
x
Reference in New Issue
Block a user