arqex / arqex/react-datetime

TimeConstraints option does't apply after rerender component

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

Description

```
[x] Bug report
[ ] Feature request
[ ] Support request
```

### Steps to Reproduce
Render Datetime component with timeConstraints property
For example: `{ hours: { min: 9 }, minutes: { min: 30 }}`
Then rerender component with `{ hours: { min: 9 }, minutes: { min: 40 }}`

### Expected Results
timeConstraints should changes

### Actual Results
timeConstraints does't apply after rerender component with other timeConstraints property

### Other Information (e.g. stacktraces, related issues, suggestions how to fix)
I use two `DateTime` fields and time in second field should't be less then in a first. First DateTime component update parent state in `onChangeStartTime` function. `this.calculateEndTimeConstraints()` calculates `timeConstraints`. `timeConstraints` only work on load page (mount component). After update first `DateTime` field `timeConstraints` calculates correctly, but they don't apply in the second `DateTime` component.
```


```

Contributor guide

Open the contributing guide

Research direction

Start by locating the Datetime component entry point and its handling of timeConstraints during rerenders, then reproduce the difference between initial mount and updated props using the two DateTime fields described. Done means changing the constraints from a 30-minute minimum to a 40-minute minimum causes the second component to enforce the new value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.