Skip to content

Commit

Permalink
Fix tabIndex not getting reset in IE11
Browse files Browse the repository at this point in the history
Follow up to #3060
  • Loading branch information
marvinhagemeister committed Mar 14, 2021
1 parent cd8d658 commit ec1c3d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/diff/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,17 @@ export function setProperty(dom, name, value, oldValue, isSvg) {
name !== 'href' &&
name !== 'list' &&
name !== 'form' &&
// Default value in browsers is `-1` and an empty string is
// cast to `0` instead
name !== 'tabIndex' &&
name !== 'download' &&
name in dom
) {
try {
dom[name] = value == null ? '' : value;
dom[name] =
value == null
? // In IE11 the default value for `tabIndex` is `0` instead
// of `-1` like in all other browsers.
// prettier-ignore
name == 'tabIndex' ? -1 : ''
: value;
// labelled break is 1b smaller here than a return statement (sorry)
break o;
} catch (e) {}
Expand Down

0 comments on commit ec1c3d5

Please sign in to comment.