Go Pro Sign Up Login
0 days 0 hrs 0 min 0 sec

Summer Sale

50% off Level Up Pro until you unsubscribe.
Get access to ALL 128 courses on Level Up Tutorials

This is your last chance to get Level Up Pro for $145/year.

or Learn More
Moon Moon

Buy Now and unlock this series

$

49

.99

$

39

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

Tab Index and Accessibility

Now we will do some final tune-up on our tabs project and make sure that our tabs have good accessibility.

Downloads

Become a pro to download code and videos

Comments

Steve Skladany

9 months ago

There's a small error in the "dispatchEvent" call. To use the "detail" property, you need to use "new CustomEvent()" instead of "new Event()" -- otherwise the "detail" property is simply ignored. e.g.:

        element.dispatchEvent(
          new CustomEvent("lut-tab-changed", {
            bubbles: true,
            detail: {
              relatedTarget: selectedPanel,
            },
          })
        );

https://javascript.info/dispatch-events#custom-events

Steve Skladany

9 months ago [edited]

Want to join the conversation?

Become a Pro member today!