Teact: Fix jumping cursor when typing in Safari

This commit is contained in:
Alexander Zinchuk 2022-02-02 22:48:36 +01:00
parent 1f29bb2306
commit 1aaf5132c3

View File

@ -436,7 +436,9 @@ function setAttribute(element: HTMLElement, key: string, value: any) {
element.className = value;
// An optimization attempt
} else if (key === 'value') {
(element as HTMLInputElement).value = value;
if ((element as HTMLInputElement).value !== value) {
(element as HTMLInputElement).value = value;
}
} else if (key === 'style') {
element.style.cssText = value;
} else if (key === 'dangerouslySetInnerHTML') {