ui: [BUGFIX] Replace all replaceAll with split.join for older browsers without replaceAll (#9715)

* ui: replace all `replaceAll` with split.join

* Use a div instead of fieldset for flex-box reasons
This commit is contained in:
John Cowen 2021-02-11 09:49:39 +00:00 committed by GitHub
parent 194fb0d144
commit 551ac7b794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 4 deletions

3
.changelog/9715.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Fixed a bug in older browsers relating to String.replaceAll and fieldset w/flexbox usage
```

View File

@ -21,7 +21,10 @@ export default class Element extends Component {
}
}
get prop() {
return `${this.args.name.toLowerCase().replaceAll('.', '-')}`;
return `${this.args.name
.toLowerCase()
.split('.')
.join('-')}`;
}
get state() {
const error = this.touched && this.args.error;

View File

@ -1,4 +1,4 @@
<fieldset
<div
class="freetext-filter"
...attributes
>
@ -16,4 +16,4 @@
/>
</label>
{{yield}}
</fieldset>
</div>

View File

@ -4,6 +4,7 @@
display: flex;
position: relative;
height: var(--height);
width: 100%;
}
&_input,
& > label {

View File

@ -4,6 +4,7 @@ export default function missingMessage(key, locales) {
const last = key
.split('.')
.pop()
.replaceAll('-', ' ');
.split('-')
.join(' ');
return `${last.substr(0, 1).toUpperCase()}${last.substr(1)}`;
}