-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 read-only tab dialog to cancel tab closing when dismissed #9573
Conversation
@zadjii-msft - I think this one worth pushing into 1.7 |
<data name="CloseReadOnlyDialog.CloseButtonText" xml:space="preserve"> | ||
<value>Close anyway</value> | ||
<value>Cancel</value> | ||
</data> | ||
<data name="CloseReadOnlyDialog.PrimaryButtonText" xml:space="preserve"> | ||
<value>Cancel</value> | ||
<value>Close anyway</value> | ||
</data> |
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 was going to be one of the cases where we have to rename the whole dialog. We do not.
If the read-only dialog was in stable (1.6), and I was not backporting the fix, I would ask you to change the CloseReadOnlyDialog
name. Here's why:
When the localization build phase runs, it downloads the latest available strings -- WITH NO REGARD FOR VERSION. So, if we change the meaning of an existing string in the preview build (especially to a backwards meaning like this one!), the next stable build will receive the new meaning for all of the translations. . . except for english. The english strings follow the code in the branch, where the translated strings follow the code in main (!)
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.
Thanks. This is 100% the correct solution. We've got to be careful about these dialogs!
Hello @DHowett! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 107 seconds. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Currently dismissing "are you sure you wish to close read-only tab or pane" dialog by pressing `ESC` will not abort tab closing (aka the tab will be closed!) The reason for this, is that we cancel, only if the "Cancel" is pressed (aka result=PrimaryButton, while ESC returns result=None). This PR fixes this, by doing what we usually do: * Putting Cancel in the CloseButton (which is also triggered by ESC) * Aborting the action if the result is not a Primary Button However, since we want Cancel to be a default action, we set CloseButton to be the DefaultButton in XAML (cherry picked from commit 9bd097f)
🎉 Handy links: |
🎉 Handy links: |
Currently dismissing "are you sure you wish to close read-only tab or pane"
dialog by pressing
ESC
will not abort tab closing(aka the tab will be closed!)
The reason for this, is that we cancel, only if the "Cancel" is pressed
(aka result=PrimaryButton, while ESC returns result=None).
This PR fixes this, by doing what we usually do:
However, since we want Cancel to be a default action,
we set CloseButton to be the DefaultButton in XAML