Skip to content

Commit 2022ca5

Browse files
committed
fix(jsx): fix jsx htmlfor incompatibility
1 parent fa36e7c commit 2022ca5

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/declarations/jsx.ts

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

361362
export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -452,6 +453,7 @@ export namespace JSXElements {
452453
export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
453454
form?: string;
454455
htmlFor?: string;
456+
htmlfor?: string;
455457
name?: string;
456458
}
457459

src/renderer/vdom/set-accessor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ export const setAccessor = (plt: d.PlatformApi, elm: HTMLElement, memberName: st
122122
}
123123

124124
} else if (newValue != null && memberName !== 'key') {
125+
if (_BUILD_.isDev && memberName === 'htmlfor') {
126+
console.error(`Attribute "htmlfor" set on ${elm.tagName.toLowerCase()}, with the lower case "f" must be replaced with a "htmlFor" (capital "F")`);
127+
}
125128
// Element Attributes
126129
updateAttribute(elm, memberName, newValue);
127130

0 commit comments

Comments
 (0)