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

AndroidEditable doesn't react on readOnly prop change #4994

Open
belianikov opened this issue May 17, 2022 · 2 comments
Open

AndroidEditable doesn't react on readOnly prop change #4994

belianikov opened this issue May 17, 2022 · 2 comments

Comments

@belianikov
Copy link

belianikov commented May 17, 2022

Description
AndroidEditable doesn't react on readOnly prop change. If it was set to true when AndroidEditable was initialized it will remain in read only mode. In browser it looks like text being inserted, but no updates in editor happens.

Steps
To reproduce the behavior:

  1. Start editor with readOnly set to true
  2. Type in any text
  3. console.log(editor.children) to see that there is no change

Expectation
AndroidEditable should be able to react on change of readOnly prop after initialization.

Environment

  • Slate-React 0.79.0
  • Android Emulator API 31
  • Chrome

Context
Error is caused by dependency list in isomorphicLayoutEffect adding listener to beforeinput event in android-editable.tsx

image

onDOMBeforeInput does update when readOnly changes, but the effect doesn't react to that.

This should work fine, unless there are reasons i miss for using specifically propsOnDOMBeforeInput.

image

@mrganser
Copy link

Happening to me as well, you even can reproduce it by changing to an Android device from dev tools in a desktop Chrome, because it'll use AndroidEditable.

@mrganser
Copy link

mrganser commented Mar 9, 2023

@belianikov @BitPhinix I've seen the whole Android thing is merged, which it's mentioning this ticket, but I think this is still happening, at least in my environment, and since this is still opened I wasn't sure. Is this still a thing?

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

No branches or pull requests

2 participants