-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Link): Do not ignore onMouseEnter prop with absolute href (#32012)
Fixes #22733 Regardless of whether it's recommended that Link be used with external href values or not, they can be used and `onMouseEnter` being swallowed with an external href value is unexpected behavior. ## Bug - [x] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint`
- Loading branch information
1 parent
332cd06
commit f225179
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ export async function getServerSideProps({ query: { port } }) { | |
|
||
export default function Page({ port }) { | ||
const router = useRouter() | ||
const [hover, setHover] = React.useState(false) | ||
|
||
return ( | ||
<> | ||
<Link href="https://vercel.com/"> | ||
|
@@ -61,6 +63,17 @@ export default function Page({ port }) { | |
<Link href="mailto:[email protected]"> | ||
<a id="mailto-link">mailto:[email protected]</a> | ||
</Link> | ||
<br /> | ||
<Link href="https://vercel.com/"> | ||
<a | ||
id="absolute-link-mouse-events" | ||
data-hover={hover} | ||
onMouseEnter={() => setHover(true)} | ||
onMouseLeave={() => setHover(false)} | ||
> | ||
https://vercel.com/ | ||
</a> | ||
</Link> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters