Skip to content

Commit eab4750

Browse files
feat: add margin left to group option
1 parent 6eacbb4 commit eab4750

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

packages/ui/src/FormWidgets/Select/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useEffect, useMemo, useRef, useState } from "react";
2-
32
import Divider from "@/Divider";
43

54
import { PopupMenu, PopupMenuProperties } from "../../Popup";
@@ -451,9 +450,10 @@ export const Select = <T extends string | number>({
451450
role="option"
452451
className={
453452
`${!multiple && value === option.value ? "selected" : ""}
454-
${disabled ? "disabled" : ""}
455-
${index === focusedOptionIndex ? "focused" : ""}
456-
`.trim() || undefined
453+
${isGrouped ? "group-option" : ""}
454+
${disabled ? "disabled" : ""}
455+
${index === focusedOptionIndex ? "focused" : ""}
456+
`.trim() || undefined
457457
}
458458
onClick={() => {
459459
if (!disabled) {

packages/ui/src/assets/css/form-widgets/select.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143
font-weight: 600;
144144
}
145145

146+
.select-menu ul > li.group-option {
147+
margin-left: 0.5rem;
148+
}
146149

147150
.select-menu ul > li:hover:not(.group-label),
148151
.select-menu ul > li.focused:not(.group-label) {

0 commit comments

Comments
 (0)