Skip to content

Commit

Permalink
fix(color-picker): update translate sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
Nantawat-Poothong committed Nov 2, 2022
1 parent 52bdbfe commit 68de723
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/elements/src/color-picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,17 @@ export class ColorPicker extends ControlElement {
this._colorAriaLabel = name;
return;
}
const translate = await Promise.all([this.colorTPromise(tone),
const translate = await Promise.all([
this.colorTPromise(main),
this.colorTPromise('WITH', { number: percent }),
this.colorTPromise(mixed)]);
const [toneT, mainT, percentT, mixedT] = translate;
const formatTone = toneT ? `${toneT}. ` : '';
const [mainT, percentT, mixedT] = translate;
const toneT = tone ? `${await this.colorTPromise(tone)}. ` : '';
if (percent) {
this._colorAriaLabel = `${formatTone}${mainT} ${percentT} ${mixedT}`;
this._colorAriaLabel = `${toneT}${mainT} ${percentT} ${mixedT}`;
}
else {
this._colorAriaLabel = `${formatTone}${mainT}`;
this._colorAriaLabel = `${toneT}${mainT}`;
}
}

Expand Down

0 comments on commit 68de723

Please sign in to comment.