Skip to content

Commit

Permalink
Ignore only space from whitespace chars in Int text views.
Browse files Browse the repository at this point in the history
This is another approach to fixing jupyter-widgets#2959
  • Loading branch information
jasongrout committed Feb 19, 2022
1 parent 9151db7 commit 738f057
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/controls/src/widget_int.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,7 @@ export class IntTextView extends DescriptionView {
* Handles key press
*/
handleKeypress(e: KeyboardEvent): void {
if (/[e,.\s]/.test(String.fromCharCode(e.keyCode))) {
// Handle return key submission
if (e.keyCode === 13) {
this.handleChanged(e);
}
if (/[e,. ]/.test(String.fromCharCode(e.keyCode))) {
e.preventDefault();
}
}
Expand Down

0 comments on commit 738f057

Please sign in to comment.