MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / renderSelectText

Method renderSelectText

core/src/components/select/select.tsx:1037–1061  ·  view source on GitHub ↗

* Renders either the placeholder * or the selected values based on * the state of the select.

()

Source from the content-addressed store, hash-verified

1035 * the state of the select.
1036 */
1037 private renderSelectText() {
1038 const { placeholder } = this;
1039
1040 const displayValue = this.getText();
1041
1042 let addPlaceholderClass = false;
1043 let selectText = displayValue;
1044 if (selectText === '' && placeholder !== undefined) {
1045 selectText = placeholder;
1046 addPlaceholderClass = true;
1047 }
1048
1049 const selectTextClasses: CssClassMap = {
1050 'select-text': true,
1051 'select-placeholder': addPlaceholderClass,
1052 };
1053
1054 const textPart = addPlaceholderClass ? 'placeholder' : 'text';
1055
1056 return (
1057 <div aria-hidden="true" class={selectTextClasses} part={textPart}>
1058 {selectText}
1059 </div>
1060 );
1061 }
1062
1063 /**
1064 * Renders the chevron icon

Callers 1

renderMethod · 0.95

Calls 1

getTextMethod · 0.95

Tested by

no test coverage detected