Fix copy paste on text area
This commit is contained in:
parent
9c1115b512
commit
9331c9b9c0
1 changed files with 8 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import { TextAreaComponentType } from "../../types/components";
|
||||||
import { TypeModal } from "../../utils";
|
import { TypeModal } from "../../utils";
|
||||||
|
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
|
import { TabsContext } from "../../contexts/tabsContext";
|
||||||
|
|
||||||
export default function TextAreaComponent({
|
export default function TextAreaComponent({
|
||||||
value,
|
value,
|
||||||
|
|
@ -14,6 +15,7 @@ export default function TextAreaComponent({
|
||||||
}: TextAreaComponentType) {
|
}: TextAreaComponentType) {
|
||||||
const [myValue, setMyValue] = useState(value);
|
const [myValue, setMyValue] = useState(value);
|
||||||
const { openPopUp, closePopUp } = useContext(PopUpContext);
|
const { openPopUp, closePopUp } = useContext(PopUpContext);
|
||||||
|
const { setDisableCopyPaste } = useContext(TabsContext);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
|
|
@ -31,6 +33,12 @@ export default function TextAreaComponent({
|
||||||
<div className="flex w-full items-center">
|
<div className="flex w-full items-center">
|
||||||
<input
|
<input
|
||||||
value={myValue}
|
value={myValue}
|
||||||
|
onFocus={() => {
|
||||||
|
setDisableCopyPaste(true);
|
||||||
|
}}
|
||||||
|
onBlur={() => {
|
||||||
|
setDisableCopyPaste(false);
|
||||||
|
}}
|
||||||
className={
|
className={
|
||||||
editNode
|
editNode
|
||||||
? " input-edit-node "
|
? " input-edit-node "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue