Coder Social home page Coder Social logo

[Bug]: TypeError: Cannot read properties of undefined (reading 'selectionRoot') in Menu.handlePointerBasedSelection about spectrum-web-components HOT 3 OPEN

spdev3000 avatar spdev3000 commented on July 24, 2024
[Bug]: TypeError: Cannot read properties of undefined (reading 'selectionRoot') in Menu.handlePointerBasedSelection

from spectrum-web-components.

Comments (3)

Westbrook avatar Westbrook commented on July 24, 2024

I'm surprised that without a Menu Item that this code is finding a trigger. Can you share what the trigger is so we can understand how it is both el.getAttribute('role') === this.childRole and el.menuData === undefined?

from spectrum-web-components.

spdev3000 avatar spdev3000 commented on July 24, 2024
  handlePointerBasedSelection(event) {
    const path = event.composedPath();
    const target = path.find((el) => {
      if (!(el instanceof Element)) {
        return false;
      }
      console.log("MENU SWC: ", el);
      return el.getAttribute("role") === this.childRole;
    });

prints out:

<li class="spectrum-Menu-item" tabindex="0" role="menuitem"><span class="spectrum-Menu-itemLabel"><span>Edit version info</span></span></li>

and leads to:

    TypeError: Cannot read properties of undefined (reading 'selectionRoot')
    at Menu.handlePointerBasedSelection (chunk-SCU35XXF.js?v=c2a8ef54:347:59)
    at Menu.handlePointerup (chunk-SCU35XXF.js?v=c2a8ef54:321:10)
    at Menu.nrWrapper (chunk-DTJESBZO.js?v=c2a8ef54:71:21)

from spectrum-web-components.

najikahalsema avatar najikahalsema commented on July 24, 2024

We can add this, but we should make sure we add tests for this case.

from spectrum-web-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.