disableOptionsWhenSelectedInSiblingRepeaterItems only for specific item not working

when choosing older sibling it still disabled, i want only father and mother. is it wrong? if it is how to achieve that?
Repeater::make('parental_family_members')
->hiddenLabel()
->schema(self::inlineLabelFields([
...self::basicInfoForFamily(),
...self::genderInfoPerson(),
Select::make('relation')->label(__('registration.field.relation'))->options(__('registration.options.parental_relation'))->disableOptionsWhenSelectedInSiblingRepeaterItems(fn (string $state): bool => ! in_array($state, ['older sibling', 'younger sibling']))->required(),
...self::additionalInfoForFamily(),
]))
->columns(2)
->addActionLabel(__('registration.field.add_family_member'))
->itemLabel(fn (array $state): ?string => ! empty($state['full_name']) ? ucfirst($state['relation']).' - '.$state['full_name'] : null),
])
Repeater::make('parental_family_members')
->hiddenLabel()
->schema(self::inlineLabelFields([
...self::basicInfoForFamily(),
...self::genderInfoPerson(),
Select::make('relation')->label(__('registration.field.relation'))->options(__('registration.options.parental_relation'))->disableOptionsWhenSelectedInSiblingRepeaterItems(fn (string $state): bool => ! in_array($state, ['older sibling', 'younger sibling']))->required(),
...self::additionalInfoForFamily(),
]))
->columns(2)
->addActionLabel(__('registration.field.add_family_member'))
->itemLabel(fn (array $state): ?string => ! empty($state['full_name']) ? ucfirst($state['relation']).' - '.$state['full_name'] : null),
])
2 Replies
toeknee
toeknee4w ago
Make the sleect live first
Tomato
TomatoOP4w ago
thank you for respond, already add
->live()
->live()
but still it doenst work
No description

Did you find this page helpful?