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

bug: lowercase for in htmlFor attribute doesn't work #3473

Closed
3 tasks done
katiedeangelis opened this issue Jul 14, 2022 · 5 comments · Fixed by #5840 or ionic-team/ionic-framework#29666
Closed
3 tasks done
Assignees
Labels
Resolution: Refine This PR is marked for Jira refinement. We're not working on it - we're talking it through.

Comments

@katiedeangelis
Copy link
Contributor

Prerequisites

Stencil Version

2.17.1

Current Behavior

In my render function, I created a checkbox:

<label htmlFor={this.id}>My Label Text</label>
<input type="checkbox" id={this.id}></input>

When the component renders, "htmlFor" becomes "htmlfor" and the "My Label Text" does not toggle the checkbox.

Expected Behavior

In my render function, when "htmlFor" is added to a checkbox, that is the attribute (with case) that should render. When the component renders, I also expect that when the "My Label Text" label is clicked, the checkbox is toggled.

Steps to Reproduce

  1. Create a checkbox in a render function with the following label/input setup:
<label htmlFor={this.id}>My Label Text</label>
<input type="checkbox" id={this.id}></input>
  1. When the component renders, click the label
  2. Notice the checkbox does not toggle

Code Reproduction URL

Additional Information

I noticed in the stencil-public-runtime.ts file that there is an htmlfor element property on the LabelHTMLAttributes interface which is not correct:

   interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
        form?: string;
        htmlFor?: string;
        htmlfor?: string;
    }
@alicewriteswrongs
Copy link
Contributor

Hi @katiedeangelis, thanks for filing this issue and for filing the related PR! I get the gist of what you're reporting here, but would you mind creating a simple reproduction repo that showcases this issue? Doing so will help us confirm what's going on and also evaluate your fix PR.

@alicewriteswrongs alicewriteswrongs added the Awaiting Reply This PR or Issue needs a reply from the original reporter. label Jul 15, 2022
@ionitron-bot ionitron-bot bot removed the triage label Jul 15, 2022
@katiedeangelis
Copy link
Contributor Author

katiedeangelis commented Jul 15, 2022 via email

@ionitron-bot ionitron-bot bot removed the Awaiting Reply This PR or Issue needs a reply from the original reporter. label Jul 15, 2022
@alicewriteswrongs alicewriteswrongs added the ionitron: needs reproduction This PR or Issue does not have a reproduction case URL label Jul 18, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Jul 18, 2022

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@rwaskiewicz rwaskiewicz added Resolution: Refine This PR is marked for Jira refinement. We're not working on it - we're talking it through. and removed ionitron: needs reproduction This PR or Issue does not have a reproduction case URL labels Aug 3, 2022
@rwaskiewicz
Copy link
Contributor

Relabeling for the team to take a closer look. Thanks!

@tanner-reits
Copy link
Contributor

A fix for this was included in today's v4.19.0 release!

github-merge-queue bot pushed a commit to ionic-team/ionic-framework that referenced this issue Jun 26, 2024
### Release Notes

<details>
<summary>ionic-team/stencil (@&#8203;stencil/core)</summary>

###
[`v4.19.0`](https://togithub.com/ionic-team/stencil/blob/HEAD/CHANGELOG.md#-4190-2024-06-26)

[Compare
Source](https://togithub.com/ionic-team/stencil/compare/v4.18.3...v4.19.0)

### Bug Fixes

* **compiler:** support rollup's external input option
([#3227](stenciljs/core#3227))
([2c68849](stenciljs/core@2c68849)),
fixes [#3226](stenciljs/core#3226)
* **emit:** don't emit test files
([#5789](stenciljs/core#5789))
([50892f1](stenciljs/core@50892f1)),
fixes [#5788](stenciljs/core#5788)
* **hyrdate:** support vdom annotation in nested dsd structures
([#5856](stenciljs/core#5856))
([61bb5e3](stenciljs/core@61bb5e3))
* label attribute not toggling input
([#3474](stenciljs/core#3474))
([13db920](stenciljs/core@13db920)),
fixes [#3473](stenciljs/core#3473)
* **mock-doc:** expose ShadowRoot and DocumentFragment globals
([#5827](stenciljs/core#5827))
([98bbd7c](stenciljs/core@98bbd7c)),
fixes [#3260](stenciljs/core#3260)
* **runtime:** allow watchers to fire w/ no Stencil members
([#5855](stenciljs/core#5855))
([850ad4f](stenciljs/core@850ad4f)),
fixes [#5854](stenciljs/core#5854)
* **runtime:** catch errors in async lifecycle methods
([#5826](stenciljs/core#5826))
([87e5b33](stenciljs/core@87e5b33)),
fixes [#5824](stenciljs/core#5824)
* **runtime:** don't register listener before connected to DOM
([#5844](stenciljs/core#5844))
([9d7021f](stenciljs/core@9d7021f)),
fixes [#4067](stenciljs/core#4067)
* **runtime:** properly assign style declarations
([#5838](stenciljs/core#5838))
([5c10ebf](stenciljs/core@5c10ebf))
* **testing:** allow to re-use pages across it blocks
([#5830](stenciljs/core#5830))
([561eab4](stenciljs/core@561eab4)),
fixes [#3720](stenciljs/core#3720)
* **typescript:** remove unsupported label property
([#5840](stenciljs/core#5840))
([d26ea2b](stenciljs/core@d26ea2b)),
fixes [#3473](stenciljs/core#3473)


### Features

* **cli:** support generation of sass and less files
([#5857](stenciljs/core#5857))
([1883812](stenciljs/core@1883812)),
closes [#2155](stenciljs/core#2155)
* **compiler:** generate export maps on build
([#5809](stenciljs/core#5809))
([b6d2404](stenciljs/core@b6d2404))
* **complier:** support type import aliasing
([#5836](stenciljs/core#5836))
([7ffb25d](stenciljs/core@7ffb25d)),
closes [#2335](stenciljs/core#2335)
* **runtime:** support declarative shadow DOM
([#5792](stenciljs/core#5792))
([c837063](stenciljs/core@c837063)),
closes [#4010](stenciljs/core#4010)
* **testing:** add `toHaveLastReceivedEventDetail` event spy matcher
([#5829](stenciljs/core#5829))
([63491de](stenciljs/core@63491de)),
closes [#2488](stenciljs/core#2488)
* **testing:** allow to disable network error logging via
'logFailingNetworkRequests' option
([#5839](stenciljs/core#5839))
([dac3e33](stenciljs/core@dac3e33)),
closes [#2572](stenciljs/core#2572)
* **testing:** expose captureBeyondViewport in pageCompareScreenshot
([#5828](stenciljs/core#5828))
([cf6a450](stenciljs/core@cf6a450)),
closes [#3188](stenciljs/core#3188)

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Refine This PR is marked for Jira refinement. We're not working on it - we're talking it through.
Projects
None yet
5 participants