mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-23 07:56:47 +00:00
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,
|
skipEmptyText: true,
|
||||||
|
|
||||||
deleteEmpty: false,
|
deleteEmpty: false,
|
||||||
|
|
||||||
|
trimValue: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
getSubmitData: function() {
|
getSubmitData: function() {
|
||||||
@ -29,6 +31,9 @@ Ext.define('Proxmox.form.field.Textfield', {
|
|||||||
let me = this;
|
let me = this;
|
||||||
|
|
||||||
let value = this.processRawValue(this.getRawValue());
|
let value = this.processRawValue(this.getRawValue());
|
||||||
|
if (me.getTrimValue() && typeof value === 'string') {
|
||||||
|
value = value.trim();
|
||||||
|
}
|
||||||
if (value !== '') {
|
if (value !== '') {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user