mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
fix!: Only fire intermediate events when editing input with invalid text. (#8054)
* fix: Fire intermediate events only when editing text input. * Prefix unused arg with underscore. * Fix tests.
This commit is contained in:
@@ -138,6 +138,7 @@ suite('Angle Fields', function () {
|
||||
suite('Validators', function () {
|
||||
setup(function () {
|
||||
this.field = new Blockly.FieldAngle(1);
|
||||
this.field.valueWhenEditorWasOpened_ = this.field.getValue();
|
||||
this.field.htmlInput_ = document.createElement('input');
|
||||
this.field.htmlInput_.setAttribute('data-old-value', '1');
|
||||
this.field.htmlInput_.setAttribute('data-untyped-default-value', '1');
|
||||
@@ -153,7 +154,7 @@ suite('Angle Fields', function () {
|
||||
return null;
|
||||
},
|
||||
value: 2,
|
||||
expectedValue: '1',
|
||||
expectedValue: 1,
|
||||
},
|
||||
{
|
||||
title: 'Force Mult of 30 Validator',
|
||||
|
||||
@@ -261,6 +261,7 @@ suite('Number Fields', function () {
|
||||
suite('Validators', function () {
|
||||
setup(function () {
|
||||
this.field = new Blockly.FieldNumber(1);
|
||||
this.field.valueWhenEditorWasOpened_ = this.field.getValue();
|
||||
this.field.htmlInput_ = document.createElement('input');
|
||||
this.field.htmlInput_.setAttribute('data-old-value', '1');
|
||||
this.field.htmlInput_.setAttribute('data-untyped-default-value', '1');
|
||||
@@ -276,7 +277,7 @@ suite('Number Fields', function () {
|
||||
return null;
|
||||
},
|
||||
value: 2,
|
||||
expectedValue: '1',
|
||||
expectedValue: 1,
|
||||
},
|
||||
{
|
||||
title: 'Force End with 6 Validator',
|
||||
|
||||
@@ -129,6 +129,7 @@ suite('Text Input Fields', function () {
|
||||
suite('Validators', function () {
|
||||
setup(function () {
|
||||
this.field = new Blockly.FieldTextInput('value');
|
||||
this.field.valueWhenEditorWasOpened_ = this.field.getValue();
|
||||
this.field.htmlInput_ = document.createElement('input');
|
||||
this.field.htmlInput_.setAttribute('data-old-value', 'value');
|
||||
this.field.htmlInput_.setAttribute('data-untyped-default-value', 'value');
|
||||
|
||||
Reference in New Issue
Block a user