Clone button enhancements (#33362)
- Add box-shadow to default tippy theme - Make colors for tabs match the ones from `.ui.tabular.menu` - Remove tippy arrow and slightly offset tooltip closer to the button - Fix setting of `aria-haspopup` when default role is used with tippy --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
e663c4a7f0
commit
9875f9b9b8
5 changed files with 12 additions and 4 deletions
|
@ -99,6 +99,7 @@ function initClonePanelButton(btn: HTMLButtonElement) {
|
|||
placement: 'bottom-end',
|
||||
interactive: true,
|
||||
hideOnClick: true,
|
||||
arrow: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -42,16 +42,17 @@ export function createTippy(target: Element, opts: TippyOpts = {}): Instance {
|
|||
visibleInstances.add(instance);
|
||||
return onShow?.(instance);
|
||||
},
|
||||
arrow: arrow || (theme === 'bare' ? false : arrowSvg),
|
||||
arrow: arrow ?? (theme === 'bare' ? false : arrowSvg),
|
||||
// HTML role attribute, ideally the default role would be "popover" but it does not exist
|
||||
role: role || 'menu',
|
||||
// CSS theme, either "default", "tooltip", "menu", "box-with-header" or "bare"
|
||||
theme: theme || role || 'default',
|
||||
offset: [0, arrow ? 10 : 6],
|
||||
plugins: [followCursor],
|
||||
...other,
|
||||
} satisfies Partial<Props>);
|
||||
|
||||
if (role === 'menu') {
|
||||
if (instance.props.role === 'menu') {
|
||||
target.setAttribute('aria-haspopup', 'true');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue