ux icon indicating copy to clipboard operation
ux copied to clipboard

[TURBO] Impossible to redirect with anchor

Open radiz13 opened this issue 1 year ago • 7 comments

Hi ! Im'm using Turbo UX with Symfony 7, I can confirm anchors don't work. If turbo-core is enable :

$url = $this->generateUrl('back_client_actu_gerer').'#article'.$article->getId();
return $this->redirect($url);

redirects me to "/gerer" (with or without "/" before "#") If turbo-core is disable, no problem, the same command redirects me to "/gerer#article102". There's no issue ? Thx

radiz13 avatar Feb 21 '24 08:02 radiz13

Witch version of Turbo are you using?

WebMamba avatar Feb 21 '24 09:02 WebMamba

"symfony/ux-turbo": "^2.13" = v2.14.2

radiz13 avatar Feb 21 '24 10:02 radiz13

Found a solution : 'data-turbo' => 'false' Not a good solution, the page refreshes

radiz13 avatar Mar 20 '24 13:03 radiz13

Looks like this is a Turbo issue: https://github.com/hotwired/turbo/issues/598. Could you try if the following solution feat your need: https://github.com/hotwired/turbo/issues/598#issuecomment-1670338691

WebMamba avatar Mar 21 '24 09:03 WebMamba

Found a solution : 'data-turbo' => 'false' Not a good solution, the page refreshes

radiz13 avatar Mar 21 '24 14:03 radiz13

https://github.com/hotwired/turbo/issues/211 I see your comment in this discussion. I think unfortunately we don't have more way to solve this issue than the ruby community since this is a browser issue... https://github.com/hotwired/turbo/issues/211#issuecomment-966570923. I think the best way could be to manually scroll to your anchor with javascript. Sorry about that.

WebMamba avatar Mar 21 '24 14:03 WebMamba

Ok, thanks for your response

radiz13 avatar Mar 21 '24 15:03 radiz13