Skip to content

Commit

Permalink
ui: [BUGFIX] Replace all replaceAll with split.join for older browser…
Browse files Browse the repository at this point in the history
…s without replaceAll (#9715)

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

* Use a div instead of fieldset for flex-box reasons
  • Loading branch information
johncowen authored and hashicorp-ci committed Feb 11, 2021
1 parent db8cc86 commit 16c74e4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/9715.txt
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fixed a bug in older browsers relating to String.replaceAll and fieldset w/flexbox usage
```
Expand Up @@ -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;
Expand Down
@@ -1,4 +1,4 @@
<fieldset
<div
class="freetext-filter"
...attributes
>
Expand All @@ -16,4 +16,4 @@
/>
</label>
{{yield}}
</fieldset>
</div>
Expand Up @@ -4,6 +4,7 @@
display: flex;
position: relative;
height: var(--height);
width: 100%;
}
&_input,
& > label {
Expand Down
3 changes: 2 additions & 1 deletion ui/packages/consul-ui/app/utils/intl/missing-message.js
Expand Up @@ -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)}`;
}

0 comments on commit 16c74e4

Please sign in to comment.