Skip to content

Commit

Permalink
Fixed #1906 - Tooltip is not working with 'disabled' attribute of HTM…
Browse files Browse the repository at this point in the history
…L element as expected.
  • Loading branch information
mertsincan committed Mar 26, 2021
1 parent cb8c011 commit 75c8363
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,21 @@ export class Tooltip extends Component {
}

isDisabled(target) {
return this.getTargetOption(target, 'disabled') === 'true' || this.props.disabled;
return this.getTargetOption(target, 'disabled') === 'true' || this.hasTargetOption(target, 'disabled') || this.props.disabled;
}

getTargetOption(target, option) {
if (target && target.hasAttribute(`data-pr-${option}`)) {
if (this.hasTargetOption(target, `data-pr-${option}`)) {
return target.getAttribute(`data-pr-${option}`);
}

return null;
}

hasTargetOption(target, option) {
return target && target.hasAttribute(option);
}

getEvents(target) {
let showEvent = this.getTargetOption(target, 'showevent') || this.props.showEvent;
let hideEvent = this.getTargetOption(target, 'hideevent') || this.props.hideEvent;
Expand Down

0 comments on commit 75c8363

Please sign in to comment.