-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyondWork surrounding upgrading and evolving views in the site editor and beyond[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
What problem does this address?
Currently, DataViews actions support handling user interactions. However, no explicit support exists for a "link" type that can enable navigation without custom implementations, such as;
{
id: 'open-foo-link',
label: __( 'Foo' ),
callback: () => {
window.location.href = `https://example.com/foo`;
},
}This can lead to inconsistent behavior, such as broken native browser interactions for cmd+click, ctrl+click, and middle-click. This also impacts accessibility and increases complexity when a native tag could easily handle these use cases.
What is your proposed solution?
Adding a "link" type here
gutenberg/packages/dataviews/src/types.ts
Line 481 in c3ca59b
| export type Action< Item > = ActionModal< Item > | ActionButton< Item >; |
{
type: 'link',
href: 'https://example.com',
label: 'Go to Example',
target: '_blank',
}ryelle
Metadata
Metadata
Assignees
Labels
[Feature] DataViewsWork surrounding upgrading and evolving views in the site editor and beyondWork surrounding upgrading and evolving views in the site editor and beyond[Type] EnhancementA suggestion for improvement.A suggestion for improvement.