mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:13:44 +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) => {
|
onContextMenu={(e) => {
|
||||||
// only prevent it on Windows
|
// 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={[
|
sx={[
|
||||||
({ palette }) => ({
|
({ palette }) => ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user