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

fix(engine): fixing tab index assert #773

Merged
merged 2 commits into from
Oct 26, 2018

Conversation

davidturissini
Copy link
Contributor

Details

  • an assert call in handleFocusIn was calling tabIndex against the patched tabIndex value. We want to know what the actual value in the element is instead.

Does this PR introduce a breaking change?

  • Yes
  • No

setTimeout(() => addEventListener.call(currentTarget, 'focusin', focusInEventHandler), 1);
setTimeout(() => {
// only reinstate the focus if the tabindex is still -1
if (tabIndexGetter.call(currentTarget) === -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there is a rehydration in the microtask that reset the tabindex to 0 or null, this focusin event will not be needed.

Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 9c17255 | Target commit: 64790d6

lwc-engine-benchmark

table-append-1k metric base(9c17255) target(64790d6) trend
benchmark-table/append/1k duration 149.70 (±4.45 ms) 165.40 (±5.25 ms) +15.7ms (10.5%) 👎
table-clear-1k metric base(9c17255) target(64790d6) trend
benchmark-table/clear/1k duration 6.50 (±0.30 ms) 7.10 (±0.20 ms) +0.6ms (9.2%) 👎
table-create-10k metric base(9c17255) target(64790d6) trend
benchmark-table/create/10k duration 867.10 (±6.10 ms) 916.30 (±6.95 ms) +49.2ms (5.7%) 👎
table-create-1k metric base(9c17255) target(64790d6) trend
benchmark-table/create/1k duration 112.50 (±2.15 ms) 122.10 (±2.25 ms) +9.6ms (8.5%) 👎
table-update-10th-1k metric base(9c17255) target(64790d6) trend
benchmark-table/update-10th/1k duration 75.05 (±2.30 ms) 81.10 (±1.50 ms) +6.0ms (8.1%) 👎
tablecmp-append-1k metric base(9c17255) target(64790d6) trend
benchmark-table-component/append/1k duration 229.15 (±15.95 ms) 257.50 (±8.35 ms) +28.3ms (12.4%) 👎
tablecmp-clear-1k metric base(9c17255) target(64790d6) trend
benchmark-table-component/clear/1k duration 11.30 (±1.65 ms) 13.50 (±1.65 ms) +2.2ms (19.5%) 👎
tablecmp-create-10k metric base(9c17255) target(64790d6) trend
benchmark-table-component/create/10k duration 1639.85 (±10.65 ms) 1736.20 (±11.45 ms) +96.4ms (5.9%) 👎
tablecmp-create-1k metric base(9c17255) target(64790d6) trend
benchmark-table-component/create/1k duration 203.60 (±6.15 ms) 210.00 (±5.95 ms) +6.4ms (3.1%) 👎
tablecmp-update-10th-1k metric base(9c17255) target(64790d6) trend
benchmark-table-component/update-10th/1k duration 70.75 (±4.40 ms) 75.40 (±5.00 ms) +4.7ms (6.6%) 👎
wc-append-1k metric base(9c17255) target(64790d6) trend
benchmark-table-wc/append/1k duration 230.05 (±9.50 ms) 241.30 (±15.20 ms) +11.3ms (4.9%) 👎
wc-clear-1k metric base(9c17255) target(64790d6) trend
benchmark-table-wc/clear/1k duration 20.70 (±2.65 ms) 24.15 (±2.25 ms) +3.4ms (16.7%) 👎
wc-create-10k metric base(9c17255) target(64790d6) trend
benchmark-table-wc/create/10k duration 1759.45 (±27.35 ms) 1747.40 (±60.35 ms) -12.0ms (0.7%) 👌
wc-create-1k metric base(9c17255) target(64790d6) trend
benchmark-table-wc/create/1k duration 201.95 (±4.65 ms) 213.15 (±7.25 ms) +11.2ms (5.5%) 👎
wc-update-10th-1k metric base(9c17255) target(64790d6) trend
benchmark-table-wc/update-10th/1k duration 73.95 (±5.50 ms) 77.75 (±5.95 ms) +3.8ms (5.1%) 👎

@salesforce-best-lwc-internal
Copy link

Benchmark results

Base commit: 9c17255 | Target commit: 5068f98

lwc-engine-benchmark

table-append-1k metric base(9c17255) target(5068f98) trend
benchmark-table/append/1k duration 149.70 (±4.45 ms) 161.35 (±4.85 ms) +11.7ms (7.8%) 👎
table-clear-1k metric base(9c17255) target(5068f98) trend
benchmark-table/clear/1k duration 6.50 (±0.30 ms) 7.25 (±0.45 ms) +0.8ms (11.5%) 👎
table-create-10k metric base(9c17255) target(5068f98) trend
benchmark-table/create/10k duration 867.10 (±6.10 ms) 915.20 (±5.65 ms) +48.1ms (5.5%) 👎
table-create-1k metric base(9c17255) target(5068f98) trend
benchmark-table/create/1k duration 112.50 (±2.15 ms) 122.85 (±2.75 ms) +10.3ms (9.2%) 👎
table-update-10th-1k metric base(9c17255) target(5068f98) trend
benchmark-table/update-10th/1k duration 75.05 (±2.30 ms) 81.55 (±1.80 ms) +6.5ms (8.7%) 👎
tablecmp-append-1k metric base(9c17255) target(5068f98) trend
benchmark-table-component/append/1k duration 229.15 (±15.95 ms) 258.35 (±5.60 ms) +29.2ms (12.7%) 👎
tablecmp-clear-1k metric base(9c17255) target(5068f98) trend
benchmark-table-component/clear/1k duration 11.30 (±1.65 ms) 13.65 (±1.50 ms) +2.3ms (20.8%) 👎
tablecmp-create-10k metric base(9c17255) target(5068f98) trend
benchmark-table-component/create/10k duration 1639.85 (±10.65 ms) 1743.65 (±13.95 ms) +103.8ms (6.3%) 👎
tablecmp-create-1k metric base(9c17255) target(5068f98) trend
benchmark-table-component/create/1k duration 203.60 (±6.15 ms) 208.65 (±5.90 ms) +5.0ms (2.5%) 👎
tablecmp-update-10th-1k metric base(9c17255) target(5068f98) trend
benchmark-table-component/update-10th/1k duration 70.75 (±4.40 ms) 73.40 (±4.60 ms) +2.7ms (3.7%) 👎
wc-append-1k metric base(9c17255) target(5068f98) trend
benchmark-table-wc/append/1k duration 230.05 (±9.50 ms) 250.00 (±8.50 ms) +19.9ms (8.7%) 👎
wc-clear-1k metric base(9c17255) target(5068f98) trend
benchmark-table-wc/clear/1k duration 20.70 (±2.65 ms) 24.75 (±2.60 ms) +4.1ms (19.6%) 👎
wc-create-10k metric base(9c17255) target(5068f98) trend
benchmark-table-wc/create/10k duration 1759.45 (±27.35 ms) 1772.50 (±35.45 ms) +13.0ms (0.7%) 👌
wc-create-1k metric base(9c17255) target(5068f98) trend
benchmark-table-wc/create/1k duration 201.95 (±4.65 ms) 212.45 (±5.05 ms) +10.5ms (5.2%) 👎
wc-update-10th-1k metric base(9c17255) target(5068f98) trend
benchmark-table-wc/update-10th/1k duration 73.95 (±5.50 ms) 74.80 (±4.15 ms) +0.9ms (1.1%) 👌

@davidturissini davidturissini merged commit 667b929 into master Oct 26, 2018
@davidturissini davidturissini deleted the dturissini/fix-tab-index-assert branch October 26, 2018 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants