Conditioinal not working if key value has trailing space

Created on 25 April 2024, 2 months ago

Problem/Motivation

I had one case where the client requested a select element change - renaming of the items, and when i copy/pasted from word i noticed the following:

One of the select item keys had a trailing space. Noticed this in the source tab:

   '#options':
          'option_one': 'My cool option one'
          'option_two ': 'My cool option two that is not working on a conditional dependent field'

Meanwhile the depended field has the following:

  dependent_option_two_field:
    '#type': processed_text
    '#states':
      visible:
        ':input[name="lidhje_te_reja"]':
          value: 'option_two '

The conditional seems to be not working. However if i remove the trailing slash from the parent field and reset the conditional on the child one, it works as expected.

Do we have a bug here?

πŸ› Bug report
Status

Closed: works as designed

Version

6.2

Component

Code

Created by

πŸ‡¦πŸ‡±Albania Elvin - Albania Drupal Developer

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024