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() { get prop() {
return `${this.args.name.toLowerCase().replaceAll('.', '-')}`; return `${this.args.name
.toLowerCase()
.split('.')
.join('-')}`;
} }
get state() { get state() {
const error = this.touched && this.args.error; const error = this.touched && this.args.error;

View File

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

View File

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

View File

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