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 dizzyup committed Apr 21, 2021
1 parent d802625 commit fe65a42
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fixed a bug in older browsers relating to String.replaceAll and fieldset w/flexbox usage
```
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<fieldset
<div
class="freetext-filter"
...attributes
>
Expand All @@ -16,4 +16,4 @@
/>
</label>
{{yield}}
</fieldset>
</div>
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 fe65a42

Please sign in to comment.