From 8a1b01568ef6cb4f181c49d8e958d60f82c85c06 Mon Sep 17 00:00:00 2001 From: Aayush Khopade <145590889+Apocalypse96@users.noreply.github.com> Date: Thu, 1 Aug 2024 04:04:14 +0530 Subject: [PATCH] feat: Add a blocklyNumberField CSS class to number fields (#8414) * feat: Add a blocklyNumberField CSS class to number fields https://github.com/google/blockly/issues/8313 * feat: add 'blocklyNumberField' CSS class to FieldNumber Fixes https://github.com/google/blockly/issues/8313 --- core/field_number.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/field_number.ts b/core/field_number.ts index e8e51d060..5aaf94c4c 100644 --- a/core/field_number.ts +++ b/core/field_number.ts @@ -19,6 +19,7 @@ import { FieldInputValidator, } from './field_input.js'; import * as aria from './utils/aria.js'; +import * as dom from './utils/dom.js'; /** * Class for an editable number field. @@ -307,6 +308,19 @@ export class FieldNumber extends FieldInput { return htmlInput; } + /** + * Initialize the field's DOM. + * + * @override + */ + + public override initView() { + super.initView(); + if (this.fieldGroup_) { + dom.addClass(this.fieldGroup_, 'blocklyNumberField'); + } + } + /** * Construct a FieldNumber from a JSON arg object. *