-
Notifications
You must be signed in to change notification settings - Fork 189
feat: Add support for download links in ButtonDropdown #3694
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ export interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewpor | |
* ### action | ||
* | ||
* - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link. | ||
* - `download` (boolean | string) - (Optional) Indicates that the link should be downloaded when clicked. Only works when `href` is also provided. If set to `true`, the browser will use the filename from the URL. If set to a string, that string will be used as the suggested filename. | ||
* - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided. | ||
* - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon. | ||
* - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/). | ||
|
@@ -156,6 +157,7 @@ export namespace ButtonDropdownProps { | |
disabledReason?: string; | ||
description?: string; | ||
href?: string; | ||
download?: boolean | string; | ||
external?: boolean; | ||
externalIconAriaLabel?: string; | ||
iconAlt?: string; | ||
|
@@ -165,7 +167,7 @@ export namespace ButtonDropdownProps { | |
} | ||
|
||
export interface CheckboxItem | ||
extends Omit<ButtonDropdownProps.Item, 'href' | 'external' | 'externalIconAriaLabel' | 'itemType'> { | ||
extends Omit<ButtonDropdownProps.Item, 'href' | 'download' | 'external' | 'externalIconAriaLabel' | 'itemType'> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering if we need a visual clue for download similar to external. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In practice, I think we'd want to use Having |
||
itemType: 'checkbox'; | ||
checked: boolean; | ||
} | ||
|
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 link is already not clickable when disabled. Why do we want to remove the
download
attribute?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.
Honestly, Claude added this. I agree that it doesn't really matter. The
Button
component keeps thedownload
attribute when it's disabled.