File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ class Text extends Base {
7575 * @member {String[]|null} disabledChars_=null
7676 */
7777 disabledChars_ : null ,
78+ /**
79+ * Configure the value of empty fields. null or an empty string is recommended.
80+ * @member {String|null} emptyValue=null
81+ */
82+ emptyValue : null ,
7883 /**
7984 * @member {String|null} error_=null
8085 */
@@ -950,6 +955,21 @@ class Text extends Base {
950955 return value
951956 }
952957
958+ /**
959+ * Triggered before the value config gets changed
960+ * @param {String|null } value
961+ * @param {String|null } oldValue
962+ * @returns {String|null }
963+ * @protected
964+ */
965+ beforeSetValue ( value , oldValue ) {
966+ if ( value === null || value === '' ) {
967+ return this . emptyValue
968+ }
969+
970+ return value
971+ }
972+
953973 /**
954974 * Resets the field to its original value or null depending on the clearToOriginalValue config
955975 */
You can’t perform that action at this time.
0 commit comments