Skip to content

Commit

Permalink
feat: 217
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-twu-werk committed Jan 16, 2025
1 parent 36803c8 commit 6f6df14
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/auro-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import tokensCss from "./tokens-css.js";
* @prop {String} value - Value selected for the component.
* @prop {Boolean} disabled - When attribute is present element shows disabled state.
* @prop {Boolean} noCheckmark - When true, checkmark on selected option will no longer be present.
* @prop {Boolean} displayValueProp - When true, `value` property in selected option will display in the `trigger` slot instead of default inner text of option elememnt.
* @attr {Object} optionSelected - Specifies the current selected menuOption.
* @slot - Default slot for the menu content.
* @slot label - Defines the content of the label.
Expand Down Expand Up @@ -147,7 +148,13 @@ export class AuroSelect extends LitElement {
type: Boolean,
reflect: true
},
placeholder: { type: String },
placeholder: {
type: String
},
displayValueProp: {
type: Boolean,
reflect: true
},

/**
* @private
Expand Down Expand Up @@ -229,6 +236,10 @@ export class AuroSelect extends LitElement {
clone.removeAttribute('selected');
clone.removeAttribute('class');

clone.textContent = this.displayValueProp
? option.getAttribute("value") || option.innerText
: option.innerText;

// insert the non-styled clone into the trigger
triggerContentEl.appendChild(clone);
}
Expand Down

0 comments on commit 6f6df14

Please sign in to comment.