Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ilanbm opened this issue Oct 28, 2020 · 2 comments
Open

Comments

@ilanbm
Copy link

ilanbm commented Oct 28, 2020

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])
@Jmg-21
Copy link

Jmg-21 commented Nov 18, 2020

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

@tim-field
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants