-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New props, functionalities and behaviour #18
Open
Serg4554
wants to merge
15
commits into
TeamWertarbyte:master
Choose a base branch
from
Serg4554:minutes-steps-and-onchange-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
be91fd6
Added minutesSteps, cancelOnClose and calling onChange when time changes
Serg4554 9683c74
Fixed code style
Serg4554 49cb3ff
Bugs in uncontrolled mode fixed
Serg4554 aabcbaf
Updated snapshots and test specs
Serg4554 1e069f5
Ammend last removed line
Serg4554 c513fc1
inputClasses property added
Serg4554 3f2953f
Updated snapshot
Serg4554 2add890
Disabled numbers with less opacity (disabled class)
Serg4554 b66f299
Code cleaned
Serg4554 dfe2d86
Added updateImmediately property
Serg4554 4c9eb3a
Set initValue when value prop is updated
Serg4554 256e1ab
Updated snapshots
Serg4554 7328a86
Renamed property: cancelOnClose to selectOnClose
Serg4554 8aba6e0
Props alphabetically sorted
Serg4554 bb09972
Standard style
Serg4554 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,6 @@ describe('<TimePicker />', () => { | |
.simulate('click', testUtils.stubClickEvent(190, 230)) // click on 25 | ||
.simulate('mouseup', testUtils.stubClickEvent(190, 230)) // click on 25 | ||
|
||
expect(changeHandler).toBeCalled() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed by mistake, amended in the next commit |
||
expect(changeHandler.mock.calls[0][0].getHours()).toBe(12) | ||
expect(changeHandler.mock.calls[0][0].getMinutes()).toBe(25) | ||
}) | ||
|
@@ -260,7 +259,6 @@ describe('<TimePicker />', () => { | |
.simulate('click', testUtils.stubClickEvent(190, 230)) // click on 25 | ||
.simulate('mouseup', testUtils.stubClickEvent(190, 230)) // click on 25 | ||
|
||
expect(changeHandler).toBeCalled() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed by mistake, amended in the next commit |
||
expect(changeHandler.mock.calls[0][0].getHours()).toBe(12) | ||
expect(changeHandler.mock.calls[0][0].getMinutes()).toBe(25) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now is called in every date change and restored when canceled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? There is no reason to call the change handler when the date isn't changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that change because I needed the time text field (and some other components) to be updated when the user changes the hour in real time, so every time the user moves the clock hands,
changeHandler
is called.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, that's a good point. 🤔 We should make that optional and turn it off by default. Maybe call that prop
updateImmediately
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I think that's the best option, thus maintaining the same behavior (avoiding some developers from going crazy when updating 🙃) and providing that functionality, which in my case is very useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my intention. 👍 Adding your use case while keeping this a minor update (i.e. no breaking changes).