-
Notifications
You must be signed in to change notification settings - Fork 23
feat(Timepicker): Add combined time column #844
Conversation
…/iTwinUI-react into leah/customize-time-picker
❌ Deploy Preview for itwinui failed.
|
Updated visual tests |
It could be done like in Dialog: have a property 'onClose' (and maybe the property 'closeOnEsc' also) that takes a function that closes the component. I think this can be a new issue though. Made the issue: iTwin/iTwinUI#855 |
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.
Don't forget to add issues that was discussed in this PR (eg. test improvements, etc)
Added issue for test improvements: iTwin/iTwinUI#856 |
Another problem I found is that if the selected time is not 'visible' in the DOM, pressing tab from the menu will not allow you to enter the time dropdown. |
I will revert virtualization changes and make an issue for it. |
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.
One more issue I noticed is that using PageUp/PageDown keys in the VirtualizedTimePickerColumn
do not scroll beyond the point that the selected time is visible. In the below example, I first pressed the PageDown button a couple of times, and then the PageUp.
This can be addressed in the new PR that adds virtualization to TimePicker
Video1.webm
Reverted to before virtualization. Will make a new issue in the morning and consolidate the others I already made. |
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.
When I do this, clicking on a new time moves it to the center/end/start. Is that okay? It seems worse than before. I tried to add Core._.TimePicker.-.Combined.Storybook.-.Google.Chrome.2022-12-16.08-06-15.mp4 |
No, leave it as is, just update images. Let's hope it changed because of virtualisation. |
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 hijacked the previous bug I filed and changed it to encompass all of virtualized timepicker: iTwin/iTwinUI#856 |
Adds
useCombinedRenderer
andcombinedRenderer
properties toTimepicker
.useCombinedRenderer
combines the individual time columns into one column.combinedRenderer
allows users to customize the combined column.Some places I think could use some improvement:
return
function I am checking foruseCombinedRenderer
before each column addition so that only the combined column is shown ifuseCombinedRenderer
is true. I wanted to do a ternary, but it seemed like I wouldn't be able to have logical checks (egprecision != 'hours'
) within a set of{}
if it's not at the beginning?precision='seconds'
the reaction speed of the timepicker is noticeable slow. That's also why I have increased the time allowance in some of the tests to50000
ms. This is because I'm iterating through the times a significantly higher amount - 24 hrs * 60 mins * 60 secs vs the previous 24 hrs + 60 mins + 60 secs. I'm not sure how to alleviate this issue, but I think the relevant code is found in lines 32-54 and 333-391.Notes:
...Renderer
properties toDatepicker
so that users can customize the attachedTimepicker
.hourRenderer
,minuteRenderer
,secondRenderer
, andmeridiemRenderer
from the stories forTimepicker
because they were not visible in the control panel anyway and just appeared as dashes.LabeledInputs
for theTimepicker
stories so that they would show the relevant time precision.precision
property in the control panels of theTimepicker
stories show up as radio multichoice rather than typing it in?Closes #507
Checklist