diff --git a/ordinis-admin-ui/src/components/form/SchemaDrivenForm.tsx b/ordinis-admin-ui/src/components/form/SchemaDrivenForm.tsx index e2905cf..7df62c7 100644 --- a/ordinis-admin-ui/src/components/form/SchemaDrivenForm.tsx +++ b/ordinis-admin-ui/src/components/form/SchemaDrivenForm.tsx @@ -966,9 +966,13 @@ const ReferenceSelectField = ({ aria-invalid={Boolean(errorMsg)} aria-busy={isLoading} // appearance-none убирает OS default стрелку. - // py-2 (8px) match'ит TextInput высоту. pr-10 — место под адорнмент. + // pr-9 — место под custom адорнмент (chevron at right-3 + 12px). + // truncate/text-ellipsis форсят ellipsis на длинных option labels + // (предотвращает 'наезд' текста на chevron, см. buildOption — там + // ещё дополнительный length cap чтобы native select не overflowed). className={[ - 'w-full appearance-none border rounded-sm pl-3 pr-10 py-2 text-body font-display', + 'w-full appearance-none border rounded-sm pl-3 pr-9 py-2 text-body font-display', + 'truncate overflow-hidden whitespace-nowrap text-ellipsis', 'bg-white text-black transition-colors', 'focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent', errorMsg ? 'border-mars' : 'border-line hover:border-ink/40', @@ -1003,10 +1007,14 @@ const ReferenceSelectField = ({ /** * Build a SelectOption from a record. Uses `record.data[refField]` as the - * option id (the FK value). Label combines id with a localized name field - * when available — `OPERATIONAL — Действующий` is much friendlier than - * just `OPERATIONAL`. + * option id (the FK value). Label combines id с локализованным name'ом — + * `OPERATIONAL — Действующий` понятнее чем чистый `OPERATIONAL`. Если + * комбинация длиннее MAX_LABEL chars, name truncate'ится с ellipsis — + * иначе native `