mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
adding type annotation to field text input
This commit is contained in:
parent
7a5580b3d3
commit
cca88beb30
1 changed files with 2 additions and 1 deletions
|
@ -126,6 +126,7 @@ Blockly.FieldTextInput.prototype.showEditor_ = function(opt_quietInput) {
|
|||
// Create the input.
|
||||
var htmlInput = goog.dom.createDom('input', 'blocklyHtmlInput');
|
||||
htmlInput.setAttribute('spellcheck', this.spellcheck_);
|
||||
/** @type {!HTMLInputElement} */
|
||||
Blockly.FieldTextInput.htmlInput_ = htmlInput;
|
||||
div.appendChild(htmlInput);
|
||||
|
||||
|
@ -200,7 +201,7 @@ Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(e) {
|
|||
Blockly.FieldTextInput.prototype.validate_ = function() {
|
||||
var valid = true;
|
||||
goog.asserts.assertObject(Blockly.FieldTextInput.htmlInput_);
|
||||
var htmlInput = /** @type {!Element} */ (Blockly.FieldTextInput.htmlInput_);
|
||||
var htmlInput = Blockly.FieldTextInput.htmlInput_;
|
||||
if (this.sourceBlock_ && this.changeHandler_) {
|
||||
valid = this.changeHandler_(htmlInput.value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue