Skip to content

Commit d4b35a9

Browse files
committed
fix(htmlFor): remove htmlfor from jsx attributes
Closes #1183
1 parent aeda2a8 commit d4b35a9

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/declarations/jsx.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ export namespace JSXElements {
356356
export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
357357
form?: string;
358358
htmlFor?: string;
359-
htmlfor?: string;
360359
}
361360

362361
export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -453,7 +452,6 @@ export namespace JSXElements {
453452
export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
454453
form?: string;
455454
htmlFor?: string;
456-
htmlfor?: string;
457455
name?: string;
458456
}
459457

test/karma/test-app/attribute-basic/cmp.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export class AttributeBasic {
2121
<div class="customAttr">
2222
{this.customAttr}
2323
</div>
24+
<div>
25+
<label class="htmlForLabel" htmlFor={'a'}>htmlFor</label>
26+
<input type="checkbox" id={'a'}></input>
27+
</div>
2428
</div>
2529
);
2630
}

test/karma/test-app/attribute-basic/karma.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('attribute-basic', function() {
1414
expect(app.querySelector('.single').textContent).toBe('single');
1515
expect(app.querySelector('.multiWord').textContent).toBe('multiWord');
1616
expect(app.querySelector('.customAttr').textContent).toBe('my-custom-attr');
17+
expect(app.querySelector('.htmlForLabel').getAttribute('for')).toBe('a');
1718

1819
const button = app.querySelector('button');
1920
button.click();

0 commit comments

Comments
 (0)