Skip to content

RouterLink: Unable to navigate to route with special characters #10129

Closed

Description

@tarekoraby

Description of the bug / feature

If the app contains routes that contain Germanic umlauts (e.g. ÄÅÖ), RouterLink is unable to navigate to those routes

Minimal reproducible example

Assuming this view,

@Route("åöä")
public class SpecialCharacterView extends VerticalLayout {

    public SpecialCharacterView() {
        add(new Span("some content"));
    }

}

And

@Route("")
public class MainView extends VerticalLayout {
    public MainView() {
        add(new RouterLink("go to åöä", SpecialCharacterView.class));
    }
}

Navigate to MainView and click on the RouterLink

Expected behavior

The app should navigate to the åöä url

Actual behavior

The user receives an error message:

Could not navigate to '%C3%A5%C3%B6%C3%A4'
Reason: Couldn't find route for '%C3%A5%C3%B6%C3%A4'

Versions:

- Vaadin / Flow version: 14.4.8
- Java version: 11
- OS version: Windows

Activity

  1. tarekoraby commented on Feb 25, 2021

    @tarekoraby
    ContributorAuthor

    Note, the issue doesn't occur if

    1. The user enters the url directly in the browser
    2. using an Anchor: add(new Anchor("åöä", "go to åöä"));
    3. using UI.navigate(): add(new Button("go to åöä", e -> UI.getCurrent().navigate(SpecialCharacterView.class)));
  2. javier-godoy commented on Feb 25, 2021

    @javier-godoy
    Contributor

    See also #7454 (Unable to navigate to a route containing a space)

  3. Legioth commented on Dec 8, 2022

    @Legioth
    Member

    Note, the issue doesn't occur if

    The two first of those conditions do no longer hold true. Entering the URL or navigating with a non-router link (which is technically equivalent to entering a URL in the browser) are also broken based on my quick testing. This is most likely a consequence of the new router integration and bootstrapping mode that was introduced with Vaadin 15.

    I haven't tested UI::navigate, but I expect that one to still work since the path doesn't get passed through the browser in that case.

  4. added 2 commits that reference this issue on Dec 8, 2022
    a960fe1
    b1142b2
  5. added a commit that references this issue on Dec 13, 2022
    92a8cc8
  6. added a commit that references this issue on Dec 13, 2022
    0b41504
  7. added a commit that references this issue on Dec 13, 2022
    6898c3f
  8. vaadin-bot commented on Dec 19, 2022

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with Vaadin 23.3.1.

  9. added a commit that references this issue on Dec 21, 2022
    f77c65d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions