Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Fix display of ConfirmDialogProvider if not used in a callback. #241

Merged
merged 4 commits into from
Aug 13, 2018

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Jul 23, 2018

  • Add support to use the ConfirmDialog and ConfirmDialogProvider without a callback assigned to it.
  • Fix callbacks sent to both submit and cancel at the same time.

Fix #242.

Copy link
Member

@bpostlethwaite bpostlethwaite left a comment

Choose a reason for hiding this comment

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

Perhaps a test for the non-callback functionality is warranted? If we can't use Percy to snapshot Dialogues perhaps some sort of unit test will suffice.

this.state = {
displayed: props.displayed
};
this._setStateAndProps = this._setStateAndProps.bind(this);
Copy link
Member

Choose a reason for hiding this comment

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

I don't see _setStateAndProps being passed as a callback anywhere so this .bind() isn't necessary?

};
this._setStateAndProps = this._setStateAndProps.bind(this);
this._update = this._update.bind(this);
// this._update();
Copy link
Member

Choose a reason for hiding this comment

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

⚡️

@chriddyp
Copy link
Member

@T4rk1n are you planning on adding tests to this one as per @bpostlethwaite 's recommendation? Or are confirm dialog tests too hard to add with selenium?

Also, does this fix #242?

This PR is blocking the documentation https://github.com/plotly/dash-docs/pull/123, so it'd be good to get it in soon 😺

@T4rk1n
Copy link
Contributor Author

T4rk1n commented Aug 10, 2018

@chriddyp Yes, I just didn't have the time to do it, I will fix #242 in this also, think I have the fix in stash. I'll do it soon.

@T4rk1n
Copy link
Contributor Author

T4rk1n commented Aug 13, 2018

I added tests for ConfirmDialog without callbacks and fixed #242.

@chriddyp please review.

@chriddyp
Copy link
Member

💃 thanks!

@T4rk1n T4rk1n merged commit 895d3e3 into master Aug 13, 2018
@T4rk1n T4rk1n deleted the confirm-dialog-state branch August 13, 2018 19:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants