Skip to content

Commit

Permalink
fix: picker control only trigger tip on icon (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxming authored Jan 16, 2025
1 parent 998a3e7 commit b16465b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class QuillToolbarTip {
}
const targetLabel = this.getControlLabel(toolControlItem);
if (!targetLabel || (isUndefined(currentControlOption) && isUndefined(parentOptions))) continue;
console.log(targetLabel);
const instance = createTooltip(targetLabel, {
...this.options.defaultTooltipOptions,
...currentControlOption,
Expand All @@ -83,7 +84,7 @@ export class QuillToolbarTip {
}

getControlLabel([_, target]: [ string, HTMLButtonElement | HTMLSelectElement]) {
return target.tagName.toLowerCase() === 'button' ? target : target.previousElementSibling as HTMLElement | null;
return target.tagName.toLowerCase() === 'button' ? target : target.previousElementSibling!.querySelector('.ql-picker-label') as HTMLElement | null;
}

destroyAllTips() {
Expand Down

0 comments on commit b16465b

Please sign in to comment.