arqex / arqex/react-datetime

onChange prop overwriting default on change listener ?

Open
#453 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

### I'm Submitting a ...
```
[x] Bug report
[ ] Feature request
[ ] Support request
```
### Steps to Reproduce
Using react-datetime inside a semantic column :
```js



this.dateHandler(data,'date_from')} inputProps={{placeholder: 'From'}} className="ui form field" value={this.getDate('date_from')} />


this.dateHandler(data, 'date_to')} inputProps={{placeholder: 'To'}} className="ui form field" value={this.getDate('date_to')} />



```

### Expected Results
The component would expectedly still display the menu open after a click, and updates the value field, but it doesn't. Value isn't a problem as I use the component as a controlled component, receiving value from a Redux store, however the selection view disappearing right after click is a bit more inconvenient

### Actual Results

No default behaviour

Any idea as to why the default onChange behaviour gets overwritten ?

For reference, here is my event handler on my dumb component :
```js
dateHandler(date, fromOrTo)
{
this.props.dateHandling(date._d, fromOrTo);
}
```

And the one on the smart component:
```js
dateHandler(date, fromTo)
{
if (date !== undefined)
{
let selectionObject = {};
selectionObject[fromTo] = date;

this.props.someAction(someArguments);
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.