Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nav.loadUrl() can open a new web window page. #287

Open
weili96 opened this issue Sep 30, 2024 · 2 comments
Open

Nav.loadUrl() can open a new web window page. #287

weili96 opened this issue Sep 30, 2024 · 2 comments

Comments

@weili96
Copy link

weili96 commented Sep 30, 2024

if has a parameter can let Nav.loadUrl open a new window? how can implement it ? maybe i can do it from your point out.

@linux-root
Copy link
Contributor

@weili96 If you want to open an external link in a new browser tab, this should work:

  def loadUrlInNewTab[F[_]: Async](href: String): Cmd[F, Nothing] =
    Cmd.SideEffect {
      window.open(href, "_blank")
    }

@davesmith00000
Copy link
Member

Thanks @linux-root, and apologies @weili96, I've completely missed this issue. 😞

Without trying it, the approach suggested looks sensible. Looks like we need to improve the Nav a bit to make that an explicit option though, so thank you for bringing it to my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants