Skip to content

Commit

Permalink
navigation _blank support
Browse files Browse the repository at this point in the history
  • Loading branch information
maxence-charriere committed May 22, 2024
1 parent 45f956a commit 047c7e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/app/browser.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package app

import "time"
import (
"time"
)

type browser struct {
AppUpdatable bool
Expand Down Expand Up @@ -43,6 +45,11 @@ func (b *browser) handleAnchorClick(ctx Context) {
return
}

switch target.Get("target").String() {
case "_blank":
return
}

event.PreventDefault()
if href := target.Get("href"); href.Truthy() {
ctx.Navigate(target.Get("href").String())
Expand Down

0 comments on commit 047c7e4

Please sign in to comment.