text field: add trimValue config
Inspired by a recent bug detected in the subscription key field, where a trailing white space caused verification issues. We might even enable the trimming by default, after checking call sites that is – most often one wants to trim the text to be submitted Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
5a3ac9b110
commit
5d7d30de0f
@ -6,6 +6,8 @@ Ext.define('Proxmox.form.field.Textfield', {
|
||||
skipEmptyText: true,
|
||||
|
||||
deleteEmpty: false,
|
||||
|
||||
trimValue: false,
|
||||
},
|
||||
|
||||
getSubmitData: function() {
|
||||
@ -29,6 +31,9 @@ Ext.define('Proxmox.form.field.Textfield', {
|
||||
let me = this;
|
||||
|
||||
let value = this.processRawValue(this.getRawValue());
|
||||
if (me.getTrimValue() && typeof value === 'string') {
|
||||
value = value.trim();
|
||||
}
|
||||
if (value !== '') {
|
||||
return value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user