-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: add target API to SideNavItem #5962
Conversation
4fb2992
to
ff45bb3
Compare
ff45bb3
to
5d6f2d3
Compare
* true if the target URL should be opened in a new browser tab, | ||
* false otherwise | ||
*/ | ||
public void setOpenInNewBrowserTab(boolean openInNewBrowserTab) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Browser
is maybe a bit redundant? setOpenInNewTab
would be enough IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name has been taken from the AC ticket: vaadin/platform#4850
(ping @rolfsmeds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tab could be confused with <vaadin-tab>
.
Even "browser tab" is a bit misleading, as it could just as well be a window (depending on your browser settings). Not sure if openInNewWindow
would be any less misleading?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setOpenInNewBrowsingContext
would be the most technically correct terminology, I guess, but very unintuitive to most developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Window
seems more misleading to me since opening in a new tab is the default behavior in most browsers.
I agree that Context
is unintuitive.
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 1 New issue |
This ticket/PR has been released with Vaadin 24.4.0.alpha3 and is also targeting the upcoming stable 24.4.0 version. |
Description
Add two new API for setting/getting the
target
property of aSideNavItem
, whose value is used to set thetarget
attribute in the internal anchor element inside the web-component:setTarget(String)
/getTarget()
- which receives any string as argumentsetOpenInNewBrowserTab(boolean)
/isOpenInNewBrowserTab()
- a convenience method that internally callssetTarget
with_blank
as value when called withtrue
.Depends on vaadin/web-components#7088
Fixes #5091
AC vaadin/platform#4850
Type of change