-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feature: dcc.Input accepts a number for its debounce argument #2593
Conversation
this.setInputValue = this.setInputValue.bind(this); | ||
this.setPropValue = this.setPropValue.bind(this); | ||
} | ||
|
||
UNSAFE_componentWillReceiveProps(nextProps) { | ||
const {value} = this.input.current; | ||
if (this.state?.pendingEvent) { |
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.
State should be defined in constructor.
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.
Good call. Changed in 0198e20
components/dash-core-components/tests/integration/input/test_debounce.py
Outdated
Show resolved
Hide resolved
LGTM, just a couple of minor nonblocking comments, but we do still need a changelog entry :) |
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.
💃
This PR changes dcc.Input so that it accepts a "number of seconds" for the debounce argument.
When passing a number, the callbacks to the Dash server are debounced accordingly.
This does not change the behaviour of a boolean debounce argument.
With this PR in place, we will be able to address this issue in the dbe project.
Contributor Checklist
optionals
CHANGELOG.md