Skip to content

Commit 9a469fd

Browse files
authored
Merge pull request #608 from zewa666/disabled-tooltips
fix(components): show tooltips even if buttons are disabled
2 parents 5ff06da + 73c7904 commit 9a469fd

File tree

2 files changed

+22
-17
lines changed
  • packages/selenium-ide/src/neo/components

2 files changed

+22
-17
lines changed

packages/selenium-ide/src/neo/components/ActionButtons/ActionButton/index.jsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,21 @@ import './style.css'
2222

2323
export default class ActionButton extends React.Component {
2424
render() {
25-
const props = { ...this.props }
25+
const { 'data-tip': dataTip, ...props } = { ...this.props }
26+
2627
delete props.isActive
2728
return (
28-
<button
29-
type="button"
30-
{...props}
31-
className={classNames(
32-
'btn-action',
33-
{ active: this.props.isActive },
34-
this.props.className
35-
)}
36-
/>
29+
<span data-tip={dataTip}>
30+
<button
31+
type="button"
32+
{...props}
33+
className={classNames(
34+
'btn-action',
35+
{ active: this.props.isActive },
36+
this.props.className
37+
)}
38+
/>
39+
</span>
3740
)
3841
}
3942

packages/selenium-ide/src/neo/components/FlatButton/index.jsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ export default class FlatButton extends React.Component {
2525
buttonRef: PropTypes.func,
2626
}
2727
render() {
28-
const props = { ...this.props }
28+
const { 'data-tip': dataTip, ...props } = { ...this.props }
2929
delete props.buttonRef
3030
return (
31-
<button
32-
type="button"
33-
ref={this.props.buttonRef}
34-
{...props}
35-
className={classNames('btn', this.props.className)}
36-
/>
31+
<span data-tip={dataTip}>
32+
<button
33+
type="button"
34+
ref={this.props.buttonRef}
35+
{...props}
36+
className={classNames('btn', this.props.className)}
37+
/>
38+
</span>
3739
) // eslint-disable-line react/prop-types
3840
}
3941
}

0 commit comments

Comments
 (0)