mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
use scroll into view instead of hash override (#39702)
fixes: #39693 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
2462c72418
commit
5a992e3f54
@ -80,10 +80,17 @@ export const ScrollForm = ({
|
||||
const scrollId = spacesToHyphens(title.toLowerCase());
|
||||
|
||||
return (
|
||||
// note that JumpLinks currently does not work with spaces in the href
|
||||
<JumpLinksItem
|
||||
key={title}
|
||||
href={`#${scrollId}`}
|
||||
onClick={() => {
|
||||
const element = document.getElementById(scrollId);
|
||||
if (element) {
|
||||
element.scrollIntoView({
|
||||
behavior: "smooth",
|
||||
block: "start",
|
||||
});
|
||||
}
|
||||
}}
|
||||
data-testid={`jump-link-${scrollId}`}
|
||||
>
|
||||
{title}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user