copy on click and ctrl+c was added
This commit is contained in:
parent
700b5a88c3
commit
c573c87066
@ -57,6 +57,10 @@ const Textarea = ({
|
|||||||
numerationValue.push(i);
|
numerationValue.push(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onTextareaClick() {
|
||||||
|
areaRef.current.select();
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isJSONField) {
|
if (isJSONField) {
|
||||||
if (modifiedValue && isJSON(modifiedValue)) {
|
if (modifiedValue && isJSON(modifiedValue)) {
|
||||||
@ -74,7 +78,10 @@ const Textarea = ({
|
|||||||
}, [areaSelect]);
|
}, [areaSelect]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper
|
||||||
|
isJSONField={isJSONField}
|
||||||
|
onFocus={isJSONField ? onTextareaClick : undefined}
|
||||||
|
>
|
||||||
{isJSONField && (
|
{isJSONField && (
|
||||||
<StyledCopyIcon
|
<StyledCopyIcon
|
||||||
src={copyIcon}
|
src={copyIcon}
|
||||||
@ -103,6 +110,7 @@ const Textarea = ({
|
|||||||
|
|
||||||
<StyledTextarea
|
<StyledTextarea
|
||||||
id={id}
|
id={id}
|
||||||
|
isJSONField={isJSONField}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onChange={(e) => onChange && onChange(e)}
|
onChange={(e) => onChange && onChange(e)}
|
||||||
maxLength={maxLength}
|
maxLength={maxLength}
|
||||||
|
Loading…
Reference in New Issue
Block a user