File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
126126 * Overwrite the expand symbol rendering, this replaces the Expand Symbol from UI Library.
127127 */
128128 @property ( { attribute : false } )
129- public renderExpandSymbol ?: ( ) => Element | TemplateResult < 1 > ;
129+ public renderExpandSymbol ?: ( ) => Element | TemplateResult < 1 > | undefined ;
130130
131131 @state ( )
132132 private iconSlotHasContent = false ;
@@ -229,11 +229,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
229229 id= "caret-button"
230230 aria-label = ${ this . caretLabel }
231231 @click = ${ this . _onCaretClicked } >
232- ${ this . renderExpandSymbol
233- ? this . renderExpandSymbol ( )
234- : html ` <uui- symbol- expand
235- aria- hidden= "true"
236- ?open= ${ this . showChildren } > </ uui- symbol- expand > ` }
232+ ${ this . #renderExpandSymbol( ) }
237233 </ butto n> `
238234 : '' }
239235 ${ this . href && this . selectOnly !== true && this . selectable !== true
@@ -249,6 +245,18 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
249245 ` ;
250246 }
251247
248+ #renderExpandSymbol( ) {
249+ if ( this . renderExpandSymbol ) {
250+ const result = this . renderExpandSymbol ( ) ;
251+ if ( result ) {
252+ return result ;
253+ }
254+ }
255+
256+ return html `<uui- symbol- expand
257+ .direction = ${ this . showChildren ? 'up' : 'down' } > </ uui- symbol- expand > ` ;
258+ }
259+
252260 static styles = [
253261 css `
254262 : host {
You can’t perform that action at this time.
0 commit comments