Skip to content

Commit ccc3b60

Browse files
committed
refactor(select): simplify needsExplicitNotchWidth
1 parent df4495e commit ccc3b60

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

core/src/components/select/select.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -785,17 +785,12 @@ export class Select implements ComponentInterface {
785785
*/
786786
this.notchSpacerEl === undefined ||
787787
/**
788-
* If no label is being used, then we
789-
* do not need to estimate the notch width.
788+
* If either the label property is being
789+
* used or the label slot is not defined,
790+
* then we do not need to estimate the notch width.
790791
*/
791-
!this.hasLabel ||
792-
/**
793-
* If the label property is being used
794-
* then we can render the label text inside
795-
* of the notch and let the browser
796-
* determine the notch size for us.
797-
*/
798-
this.label !== undefined
792+
this.label !== undefined ||
793+
this.labelSlot === null
799794
) {
800795
return false;
801796
}

0 commit comments

Comments
 (0)