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

Feature: dcc.Input accepts a number for its debounce argument #2593

Merged
merged 7 commits into from
Jul 12, 2023

Conversation

KoolADE85
Copy link
Contributor

@KoolADE85 KoolADE85 commented Jul 10, 2023

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

  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

this.setInputValue = this.setInputValue.bind(this);
this.setPropValue = this.setPropValue.bind(this);
}

UNSAFE_componentWillReceiveProps(nextProps) {
const {value} = this.input.current;
if (this.state?.pendingEvent) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

@alexcjohnson
Copy link
Collaborator

LGTM, just a couple of minor nonblocking comments, but we do still need a changelog entry :)

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@KoolADE85 KoolADE85 merged commit ce0aabe into dev Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants