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 dialog requestClose() to handle edge case #10983

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented Feb 2, 2025

Fix dialog requestClose() to handle edge case

Dialog requestClose() now directly calls close the dialog if dialog's close watcher is null.

This replaces a previous assert that's wrong.

(See WHATWG Working Mode: Changes for more details.)


/interactive-elements.html ( diff )

@lukewarlow lukewarlow marked this pull request as ready for review February 2, 2025 23:53
@lukewarlow lukewarlow force-pushed the fix-dialog-requestclose branch from 67f78ff to bc0f5ec Compare February 2, 2025 23:56
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

I guess this is more temporary patches since we haven't fixed the asymmetry between setting open and calling show().

@mfreed7 PTAL?

@lukewarlow
Copy link
Member Author

I guess this is more temporary patches since we haven't fixed the asymmetry between setting open and calling show().

Yeah idk what the end result we want is, perhaps we can change this to an assert in future and make sure close watcher is created when open is added but for now this seems like the minimal fix to prevent a crash.

I think it's potentially worth a discussion at whatnot about what we envisage the end state to be for the open attribute because it causes many an issue so it might be worth spending time fully fixing it up.

Dialog requestClose() now directly calls close the dialog if dialog's close watcher is null.

This replaces a previous assert that's wrong.
@lukewarlow lukewarlow force-pushed the fix-dialog-requestclose branch from bc0f5ec to e2f7801 Compare February 3, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants