Skip to content

Commit 73023f2

Browse files
committed
Merge pull request #234 from salesforce-ux/tooltip-bug
Bring back assistive text for disabled button with tooltip
2 parents dfc5b08 + aef8a2b commit 73023f2

File tree

11 files changed

+19
-12
lines changed

11 files changed

+19
-12
lines changed

components/SLDSPopoverTooltip/trigger.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Trigger extends React.Component {
102102
onFocus={this.handleTooltipMouseEnter.bind(this)}
103103
onMouseOut={this.handleTooltipMouseLeave.bind(this)}
104104
onBlur={this.handleTooltipMouseLeave.bind(this)}
105-
><span className="slds-assistive-text">&nbsp;</span>&nbsp;</a>:null;
105+
><span className="slds-assistive-text">{this.props.label || this.props.assistiveText}</span></a>:null;
106106
}
107107

108108
getTooltip(){

lib/SLDSButton/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
4343

4444
var classNames = require("classnames");
4545

46+
4647
var displayName = 'SLDSButton';
4748
var propTypes = {
4849
/**

lib/SLDSButtonStateful/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
4343

4444
var classNames = require("classnames");
4545

46+
4647
var blurElement = function blurElement(e) {
4748
return e.currentTarget.blur();
4849
};

lib/SLDSContextBar/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
5555

5656
var classNames = require("classnames");
5757

58+
5859
var pf = _styling2.default.pf;
5960

6061
var displayName = 'SLDSContextBar';
@@ -103,6 +104,7 @@ var ContextBar = function (_React$Component) {
103104
value: function componentWillUnmount() {}
104105
// TODO: componentWillUnmount
105106

107+
106108
// handleClick() {
107109
// if(this.props.onClick) this.props.onClick();
108110
// this.setState({ active: !this.state.active });

lib/SLDSDatepickerSingleSelect/SLDSCalendar/SLDSCalendarWeek/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ module.exports = _react2.default.createClass({
6060
}
6161
},
6262

63+
6364
render: function render() {
6465
var days = [];
6566
var date = this.props.date;

lib/SLDSLookup/Menu/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ var Menu = function (_React$Component) {
6161

6262
//Set filtered list length in parent to determine active indexes for aria-activedescendent
6363

64+
6465
_createClass(Menu, [{
6566
key: 'componentDidUpdate',
6667
value: function componentDidUpdate() {

lib/SLDSMenuList/List.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ var SLDSList = function (_React$Component) {
164164
}
165165
}
166166
}
167-
for (var i = 0; i < index; i++) {
168-
var option = this.props.options[i];
169-
if (option && option.label) {
170-
if (option.label.charAt(0).toLowerCase() === searchChar) {
167+
for (var _i = 0; _i < index; _i++) {
168+
var _option = this.props.options[_i];
169+
if (_option && _option.label) {
170+
if (_option.label.charAt(0).toLowerCase() === searchChar) {
171171
if (this.props.onUpdateHighlighted) {
172-
this.props.onUpdateHighlighted(i);
172+
this.props.onUpdateHighlighted(_i);
173173
}
174174
return;
175175
}
@@ -222,8 +222,8 @@ var SLDSList = function (_React$Component) {
222222
} else if (event.keyCode === _KEYS2.default.TAB) {} else {
223223
_EventUtil2.default.trapEvent(event);
224224
var ch = String.fromCharCode(event.keyCode);
225-
var index = parseInt(event.target.getAttribute('data-index'));
226-
this.handleSearch(index, ch);
225+
var _index = parseInt(event.target.getAttribute('data-index'));
226+
this.handleSearch(_index, ch);
227227
}
228228
}
229229
}

lib/SLDSNotification/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
3939

4040
var classNames = require("classnames");
4141

42+
4243
var displayName = "SLDSNotification";
4344
var propTypes = {
4445
/**

lib/SLDSPopover.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = _react2.default.createClass({
4242
}
4343
},
4444

45+
4546
propTypes: {
4647
// targetAttachment: React.PropTypes.string,
4748
},

lib/SLDSPopoverTooltip/trigger.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,12 @@ var Trigger = function (_React$Component) {
115115
}, {
116116
key: "getMouseEventTarget",
117117
value: function getMouseEventTarget() {
118-
var tooltipTriggerLabel = (this.props.label || this.props.assistiveText) + " tooltip trgiger";
119118
return this.props.disabled ? _react2.default.createElement(
120119
"a",
121120
{
122121
key: "MouseEventTarget",
123122
href: "javascript:void(0)",
124-
ariaHidden: true,
123+
"aria-hidden": true,
125124
tabIndex: -1,
126125
style: {
127126
backgroundColor: 'transparent',
@@ -139,7 +138,7 @@ var Trigger = function (_React$Component) {
139138
_react2.default.createElement(
140139
"span",
141140
{ className: "slds-assistive-text" },
142-
tooltipTriggerLabel
141+
this.props.label || this.props.assistiveText
143142
)
144143
) : null;
145144
}

0 commit comments

Comments
 (0)