Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking label does not toggle switch sometimes #6524

Open
nwhittaker opened this issue Feb 24, 2023 · 3 comments
Open

Clicking label does not toggle switch sometimes #6524

nwhittaker opened this issue Feb 24, 2023 · 3 comments
Labels
0 - new New issues that need assignment. a11y Issues related to Accessibility fixes or improvements. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 8 Requires input from team, consider smaller steps. has workaround Issues have a workaround available in the meantime. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - low Issue is non core or affecting less that 10% of people using the library

Comments

@nwhittaker
Copy link
Contributor

Actual Behavior

If a label and switch, paired via the for attribute, are rendered dynamically, clicking the label immediately after it renders does not toggle the switch.

Waiting a few seconds after rendering the label, for the first time, does seem to toggle the switch correctly. However subsequent re-rendering of the elements seems to sever the connection completely.

Expected Behavior

Clicking the label always toggles the switch as long as it's not in a disabled state.

Reproduction Sample

https://ember-twiddle.com/d384379a8ad315d95edc61186a54abe9

Reproduction Steps

  1. Visit the sample
  2. Click the Toggle labels button
  3. Click the Calcite label label
  4. If the switch toggles, click the Toggle labels button again and then jump back to step 2.

Reproduction Version

1.0.7

Relevant Info

Possibly related to, or an extension of, #3761.

Regression?

No response

Priority impact

p3 - not time sensitive

Impact

A workaround is to specify the label's for and the input's id attributes statically rather than dynamically. However, this only works well for one-off components where there's little risk of specifying duplicate identifiers.

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Feb 24, 2023
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive labels Feb 24, 2023
@geospatialem geospatialem added a11y Issues related to Accessibility fixes or improvements. has workaround Issues have a workaround available in the meantime. labels Feb 24, 2023
@geospatialem geospatialem added p - low Issue is non core or affecting less that 10% of people using the library estimate - 8 Requires input from team, consider smaller steps. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed needs triage Planning workflow - pending design/dev review. labels Apr 18, 2023
@nwhittaker
Copy link
Contributor Author

Another workaround, if using a label within another Stencil component where the input's id is generated:

<calcite-label for={this.inputId} ref={label => label.setAttribute('for', label.for)}>{this.labelText}</calcite-label>

@geospatialem geospatialem added this to the 2023 November Priorities milestone Jul 18, 2023
@geospatialem geospatialem removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Jul 18, 2023
@nwhittaker
Copy link
Contributor Author

Possibly supplanted by #7364.

@geospatialem
Copy link
Member

Will execute the effort of #8126 with form component ElementInternals in November to determine if the above is fixed, or if additional efforts are needed targeted for late 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. a11y Issues related to Accessibility fixes or improvements. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 8 Requires input from team, consider smaller steps. has workaround Issues have a workaround available in the meantime. impact - p3 - not time sensitive User set priority impact status of p3 - not time sensitive p - low Issue is non core or affecting less that 10% of people using the library
Projects
None yet
Development

No branches or pull requests

4 participants