How to get focus on SVG element

Hi there
I’m trying to get focus on SVG element to get focus and enter trigger action, but keep getting this error, does someone know how to solve this issue?

   this._Navigation.patch({
        LeftArrowIcon: {
          texture: lng.Tools.getSvgTexture(sampleSvg, 30, 46),
          onEnter: () => {
            Router.navigate('home-page', false);
          },
        },
      },
    });

when I trying to get focus use keyboard error, getting this error message below
]#1:[0]App:[0]Pages:[1]#29): Return value for _getFocused must be an attached descendant component

Follow the SVG doc: LightningJS.io - Documentation

Thanks!

Hi - I recommend you look through the Focus documentation:

The LeftArrowIcon needs to be the element receiving Focus from it’s parent for you to be able to press Enter on it. _getFocused function should be added to Page which returns this._Navigation which also needs a _getFocused which returns the LeftArrowIcon.

1 Like