+ role="dialog" aria-labelledby={this.id + '_header'} aria-describedby={this.id + '_content'} aria-modal={this.props.model}>
{header}
{content}
{footer}
diff --git a/src/components/tooltip/Tooltip.js b/src/components/tooltip/Tooltip.js
index dd6fd1f423..77cf9a8d74 100644
--- a/src/components/tooltip/Tooltip.js
+++ b/src/components/tooltip/Tooltip.js
@@ -38,6 +38,7 @@ export function tip(props) {
export class Tooltip extends Component {
static defaultProps = {
+ id: null,
target: null,
content: null,
disabled: false,
@@ -65,6 +66,7 @@ export class Tooltip extends Component {
}
static propTypes = {
+ id: PropTypes.string,
target: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.array]),
content: PropTypes.string,
disabled: PropTypes.bool,
@@ -449,7 +451,7 @@ export class Tooltip extends Component {
}, this.props.className);
return (
-
this.containerEl = el} className={tooltipClass} style={this.props.style}>
+
this.containerEl = el} className={tooltipClass} style={this.props.style} role="tooltip" aria-hidden={this.state.visible}>
this.tooltipTextEl = el} className="p-tooltip-text">
diff --git a/src/components/utils/DomHandler.js b/src/components/utils/DomHandler.js
index 88fec3c0dd..cb440cc176 100644
--- a/src/components/utils/DomHandler.js
+++ b/src/components/utils/DomHandler.js
@@ -123,7 +123,7 @@ export default class DomHandler {
}
static addMultipleClasses(element, className) {
- if (element) {
+ if (element && className) {
if (element.classList) {
let styles = className.split(' ');
for (let i = 0; i < styles.length; i++) {
@@ -141,7 +141,7 @@ export default class DomHandler {
}
static addClass(element, className) {
- if (element) {
+ if (element && className) {
if (element.classList)
element.classList.add(className);
else
@@ -150,7 +150,7 @@ export default class DomHandler {
}
static removeClass(element, className) {
- if (element) {
+ if (element && className) {
if (element.classList)
element.classList.remove(className);
else