Merge pull request #4146 from mfilser/fix_trim_whitespace_at_multiline_editor_fields

Fixed trim whitespace at multiline editor fields
This commit is contained in:
Lauri Ojansivu 2021-11-15 13:05:04 +02:00 committed by GitHub
commit e8e5616832
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,8 @@ InlinedForm = BlazeComponent.extendComponent({
getValue() {
const input = this.find('textarea,input[type=text]');
return this.isOpen.get() && input && input.value.replaceAll(/\s +$/gm, '');
// \s without \n + unicode (https://developer.mozilla.org/de/docs/Web/JavaScript/Guide/Regular_Expressions#special-white-space)
return this.isOpen.get() && input && input.value.replaceAll(/[ \f\r\t\v]+$/gm, '');
},
events() {