-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(b-form-input): fix debounce when value does not change #5632
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(b-form-input): fix debounce when value does not change #5632
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e102949:
|
Codecov Report
@@ Coverage Diff @@
## dev #5632 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 278 278
Lines 9409 9409
Branches 2514 2514
=========================================
Hits 9409 9409
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/bootstrap-vue/bootstrap-vue/inrh8vaix |
@KarboniteKream I made some slight adjustments to the codes so share the exact same update logic between immediate and debounced value changes. It also makes sure to always clear the debounce when Can you please re-check if this solves your problem in the generated CodeSandbox wit the latest changes: |
@jackmu95 Thanks! I've verified that the code still works correctly. |
Thanks @KarboniteKream! |
Describe the PR
This PR fixes the behavior of
debounce
onb-input-form
when the initial and final value are the same.Changing input like
value -> valu -> value
will cause theupdate
event to receivevalu
instead ofvalue
. This is becausevalue
is the same as the initial value and will not update the triggered event.I've modified the behavior to always replace the triggered event which then compares the initial and updated value before emitting an
update
event.Now the flow
value -> valu -> value
will not emit anupdate
event.PR checklist
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
dev
branch, not themaster
branch[...] (fixes #xxx[,#xxx])
, where "xxx" is the issue number)fix(alert): not alerting during SSR render
,docs(badge): update pill examples
,chore(docs): fix typo in README
, etc). This is very important, as theCHANGELOG
is generated from these messages, and determines the next version type (patch or minor).If new features/enhancement/fixes are added or changed: