Skip to content

Commit

Permalink
fix: option labels weren't showing correctly after running Cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jun 3, 2021
1 parent aa548a9 commit 10d4339
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/common/src/services/domUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function buildSelectEditorOrFilterDomElement(type: 'editor' | 'filter', c
// also translate prefix/suffix if enableTranslateLabel is true and text is a string
prefixText = (enableTranslateLabel && translaterService && prefixText && typeof prefixText === 'string') ? translaterService.translate(prefixText || ' ') : prefixText;
suffixText = (enableTranslateLabel && translaterService && suffixText && typeof suffixText === 'string') ? translaterService.translate(suffixText || ' ') : suffixText;
selectOptionLabel = (enableTranslateLabel && translaterService && optionLabel && typeof optionLabel === 'string') ? translaterService.translate(optionLabel || ' ') : optionLabel;
selectOptionLabel = (enableTranslateLabel && translaterService && selectOptionLabel && typeof selectOptionLabel === 'string') ? translaterService.translate(selectOptionLabel || ' ') : selectOptionLabel;

// add to a temp array for joining purpose and filter out empty text
const tmpOptionArray = [prefixText, (typeof labelText === 'string' || typeof labelText === 'number') ? labelText.toString() : labelText, suffixText].filter((text) => text);
Expand Down Expand Up @@ -109,7 +109,7 @@ export function buildSelectEditorOrFilterDomElement(type: 'editor' | 'filter', c
selectOptionElm.selected = (searchTerms.findIndex(term => `${term}` === `${option[valueName]}`) >= 0); // when filter search term is found then select it in dropdown
}
selectOptionElm.value = `${selectOptionValue}`;
selectOptionElm.label = selectOptionLabel;
selectOptionElm.label = `${selectOptionLabel ?? ''}`;
selectOptionsFragment.appendChild(selectOptionElm);

// if there's a search term, we will add the "filled" class for styling purposes
Expand Down

0 comments on commit 10d4339

Please sign in to comment.