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 checkbox change event not firing on enter press #12703

Merged
merged 2 commits into from
Oct 1, 2020

Conversation

Charles-Gagnon
Copy link
Contributor

The key handler was stopping the event from propagating so we never got the onchange event - which was then breaking the model view stuff since the extension side would never get its property value updated.

@@ -48,6 +48,7 @@ export class Checkbox extends Widget {
this.onkeydown(this._el, e => {
if (e.equals(KeyCode.Enter)) {
this.checked = !this.checked;
this._onChange.fire(this.checked);
Copy link
Contributor

Choose a reason for hiding this comment

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

checkbox should also handle Space key, while you are on this file, do you mind adding space key here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's already handled by the base component. If I'm remembering this correctly the reason we do this stuff here is because we want to purposely stop the propagation so that it doesn't go up and get caught by the wizard page (which would do the "OK" action).

But anyways verified that both enter and space work.

@coveralls
Copy link

coveralls commented Oct 1, 2020

Pull Request Test Coverage Report for Build 283255128

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 39.723%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/sql/base/browser/ui/checkbox/checkbox.ts 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/sql/base/browser/ui/checkbox/checkbox.ts 1 61.9%
Totals Coverage Status
Change from base Build 283231630: 0.01%
Covered Lines: 19972
Relevant Lines: 45952

💛 - Coveralls

@Charles-Gagnon Charles-Gagnon merged commit 8bf1859 into main Oct 1, 2020
@Charles-Gagnon Charles-Gagnon deleted the chgagnon/fixCheckboxEvent branch October 1, 2020 23:23
Charles-Gagnon added a commit that referenced this pull request Oct 5, 2020
* Fix checkbox change event not firing

* Add comment
kburtram pushed a commit that referenced this pull request Oct 5, 2020
* Fix checkbox change event not firing

* Add comment
halerankin pushed a commit that referenced this pull request Oct 13, 2020
* Fix checkbox change event not firing

* Add comment
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