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

Fix #1217. Save dialog changes before closing. #1218

Merged
merged 4 commits into from
Sep 16, 2021
Merged

Conversation

chenilim
Copy link
Contributor

This resolves the timing issue in FireFox between the dialog background click and onBlur handing in MarkdownEditor.

Notes:

  • When I added a breakpoint (in FireFox) to the onMouseDown handler in Dialog.tsx, the bug does not repro, even without this change
  • Not sure which part of the onClose handler causes the update to abort.

@chenilim chenilim requested a review from a team as a code owner September 15, 2021 20:33
@chenilim chenilim requested review from wiggin77 and jespino and removed request for a team September 15, 2021 20:33
Copy link
Contributor

@jespino jespino left a comment

Choose a reason for hiding this comment

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

I don't love this kind of solutions. I would add also a comment explaining that we want to give the opportunity of other components underneath to handle the click event before close.

@wiggin77
Copy link
Contributor

wiggin77 commented Sep 16, 2021

Why can't we refactor this to have deterministic ordering of the calls? I'll approve to get some sort of fix in place, but it feels like this will continue to bite us.

@chenilim chenilim changed the title Fix #1217. setTimeout(0) on dialog background click. Fix #1217. Save dialog changes before closing. Sep 16, 2021
@chenilim chenilim merged commit a66fbdb into main Sep 16, 2021
@chenilim chenilim deleted the gh1217-dialog-ff-timing branch September 16, 2021 15:42
chenilim added a commit that referenced this pull request Sep 16, 2021
* Fix #1217. setTimeout(0) on dialog background click.

* Handle onClick instead of using setTimeout

Co-authored-by: Jesús Espino <jespinog@gmail.com>
@chenilim chenilim added the CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone label Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants