Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Bugix/fire type events on active element #299
Bugix/fire type events on active element #299
Changes from 2 commits
ebd7701
82b00f0
06c660a
08bed74
dd708bf
9414e21
87fbb2a
3ebc898
85fa272
34ddb49
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think what I'd prefer is to turn
computedText
into a function calledcomputeText
which would be used in the sync case as well as here. I think it'd be something like: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.
I've updated this to the way I think it should work, but I think I may have misunderstood.
The way I understand this is....
Previously we could calculate how many total characters we can type based on the value that was already in the input before we started using
previousText
. We could then use this as a check against what we'veactuallyTyped
.Now we are using the current value (
actuallyTyped
) of the element (because thepreviousValue
may no longer apply to the current element), so we're computing how many more characters we can add at any point (not total).I had originally assumed the
isTextPastThreshold
check would be:But this felt wrong, because we're checking how many more characters we can add and then adding it to the current value and that doesn't necessarily mean it's the correct length.
So, I think what I've done is correct, but let me know if I've completely missed the point 😄
(Also, to note, where I'm saying
actuallyTyped
I've renamed it tocurrentValue
in the code because this felt more reflective of the actual usage now)