Skip to content

IBX-10879: Added possibility to disable/enable drop-down options#1894

Open
vidarl wants to merge 1 commit into4.6from
IBX-10879_Add_possibility_to_disable_enable_drop_down_options
Open

IBX-10879: Added possibility to disable/enable drop-down options#1894
vidarl wants to merge 1 commit into4.6from
IBX-10879_Add_possibility_to_disable_enable_drop_down_options

Conversation

@vidarl
Copy link
Copy Markdown
Contributor

@vidarl vidarl commented Apr 27, 2026

🎫 Issue IBX-10879

Related PRs:

Description:

This PR makes it possible to enable/disable options in a drop-down

For QA:

See QA description in ibexa/automated-translation#33

Documentation:

@vidarl vidarl force-pushed the IBX-10879_Add_possibility_to_disable_enable_drop_down_options branch from 4743a6d to cbb704a Compare April 28, 2026 09:11
@sonarqubecloud
Copy link
Copy Markdown

@vidarl vidarl requested a review from a team April 28, 2026 10:20
@ibexa-workflow-automation-1 ibexa-workflow-automation-1 Bot requested review from GrabowskiM, OstafinL, albozek, alekmick, dew326 and tischsoic and removed request for a team April 28, 2026 10:30
}

onSelect(element, selected) {
if (!element || element.classList.contains('ibexa-dropdown__item--disabled')) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: maybe it would be a good idea to put this in a separate helper function as it is repeated three times:
checkIsOptionDisabled = (option) => { return option.classList.contains('ibexa-dropdown__item--disabled') };
your call :)

const option = this.sourceInput.querySelector(`[value=${stringifiedValue}]`);

if (item) {
item.classList.add('ibexa-dropdown__item--disabled');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above. That ‘ifs’ are repeated so maybe toggleOptionEnabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants