Open
Description
- Issue Example:
- Issue:
- useSref handles click when anchor element contains a child element. This is an issue when the user wants the browser to handle the onClick event, by providing a target attribute.
- Use Case:
- The user wants the link to open in a new tab
- Cause:
- In Fix fix(sref): do not handle clicks if the dom element has a 'target' attribute Also do not handle clicks if shift or alt is being held down. #799 the targetAttr (line#87) is captured from e.target assuming that the mouse event got triggered from the anchor. But when there is a child element present inside the anchor element, the mouse event triggers the child element. The child element does not have a target attribute, which makes useSref handle the onClick.
- Fix:
- Although the target attribute is not present in e.target, it is in e.currentTarget. So we should check for e.currentTarget when getting targetAttr
Metadata
Metadata
Assignees
Labels
No labels