react-contenteditable icon indicating copy to clipboard operation
react-contenteditable copied to clipboard

Changing 'disabled' prop not working on clientside when rendered on SSR

Open ilanbm opened this issue 5 years ago • 2 comments

I'm using Next.js, it populates a div with 'contenteditable' attribute according to 'disabled' prop on server side.

When clientside toggles 'disabled' prop of the component and tries to rehydrate/rerender the component, it doesnt override the existing 'contenteditable' attribute on the div.

used this as a work around:

 useEffect(() => {
            innerRef.current.setAttribute('contenteditable', !(disabled))
  }, [innerRef,disabled])

ilanbm avatar Oct 28 '20 16:10 ilanbm

i also encoutering this issue with the same workaround hope for fix

Jmg-21 avatar Nov 18 '20 01:11 Jmg-21

Also seeing this. It doesn't seem related to SSR, I'm using ContentEditable client side, despite passing disabled={true} contenteditable=true when inspecting the source.

tim-field avatar Jan 10 '22 00:01 tim-field