Skip to content

Commit

Permalink
fix[devtools/tree/element]: onClick -> onMouseDown to handle first cl…
Browse files Browse the repository at this point in the history
…ick correctly
  • Loading branch information
hoxyq committed Mar 4, 2024
1 parent 034130c commit 0e80e1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ async function selectElement(page, displayName, waitForOwnersText) {
createTestNameSelector('ComponentTreeListItem'),
createTextSelector(listItemText),
])[0];
listItem.click();

listItem.dispatchEvent(
new MouseEvent('mousedown', {bubbles: true, cancelable: true})
);
}, displayName);

if (waitForOwnersText) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default function Element({data, index, style}: Props): React.Node {
className={className}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
onClick={handleClick}
onMouseDown={handleClick}
onDoubleClick={handleDoubleClick}
style={style}
data-testname="ComponentTreeListItem"
Expand Down

0 comments on commit 0e80e1c

Please sign in to comment.