Skip to content

Commit 14f056f

Browse files
authored
Merge pull request #212 from mashmatrix/fix-disabled-dateinput
Disable calendar icon click handling when dateinput is disabled
2 parents ef5b79b + b232598 commit 14f056f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.storybook/__storyshots__/DateInput.shot

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,12 +1440,8 @@ exports[`Disabled`] = `
14401440
type={undefined}
14411441
value="04/13/2016" />
14421442
<span
1443-
onClick={[Function]}
1444-
style={
1445-
Object {
1446-
"cursor": "pointer",
1447-
}
1448-
}
1443+
onClick={undefined}
1444+
style={undefined}
14491445
tabIndex={-1}>
14501446
<svg
14511447
aria-hidden={true}

src/scripts/DateInput.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ export default class DateInput extends Component {
182182
/>
183183
<span
184184
tabIndex={ -1 }
185-
style={ { cursor: 'pointer' } }
186-
onClick={ this.onDateIconClick }
185+
style={ props.disabled ? undefined : { cursor: 'pointer' } }
186+
onClick={ props.disabled ? undefined : this.onDateIconClick }
187187
>
188188
<Icon icon='event' className='slds-input__icon' />
189189
</span>

0 commit comments

Comments
 (0)