-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix delayed update and weird output when typing fast in AztecRN #24
Conversation
…tec native side.
Btw, this PR should go in tandem with wordpress-mobile/gutenberg-mobile#62 |
👋 @daniloercoli , tried to run the example app and it fails on my side with:
Is that expected? |
…e for AztecWrapper
Oopps! I forgot to update the demo app. Should be fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @daniloercoli ! It works nicely while editing!
I only left one, not very important comment.
@@ -86,9 +88,18 @@ protected ReactAztecText createViewInstance(ThemedReactContext reactContext) { | |||
} | |||
|
|||
@ReactProp(name = "text") | |||
public void setText(ReactAztecText view, String text) { | |||
public void setText(ReactAztecText view, ReadableMap inputMap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that important but, how about including the setIsSettingTextFromJS()
call in the conditional as well to avoid calling them at all? Effectively, we could have a new method do the text setting dance and be called conditionally. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I've moved the common code in a new private routine so setIsSettingTextFromJS
is only called when needed.
… called when the text is actually set.
LGTM! |
This PR just check the already available
mNativeEventCount
variable, and decides if the Aztec instance needs to be updated or not by matching the value.This was necessary since
Native -> JS -> Native
refresh was really downgrading performance on writing and also introducing errors on delete/write.Not completely sure this is the correct way, but it's a way that seems to work fine.