Feature/clear button for calendar drawers#4572
Conversation
Coverage Report for CI Build 28456099437Coverage decreased (-0.1%) to 59.03%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions22 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
📦 Build Artifacts Ready
|
Withalion
left a comment
There was a problem hiding this comment.
Welcome to the jungle!
| property alias hasDatePicker: dateTimePicker.hasDatePicker | ||
| property alias hasTimePicker: dateTimePicker.hasTimePicker | ||
| property bool showSeconds: false | ||
| property bool fieldValueIsNull: true |
There was a problem hiding this comment.
no need to have another property just set the value to null
| signal primaryButtonClicked | ||
| signal clearButtonClicked |
There was a problem hiding this comment.
maybe at this point we can have just one signal which says user finished picking the value
There was a problem hiding this comment.
I see that now this was mentioned in the ticket to create it
|
|
||
| drawerHeader.title: root.title | ||
|
|
||
| drawerHeader.topLeftItem.visible: !root.fieldValueIsNull |
There was a problem hiding this comment.
visibility based on dateTime value
| fontColor: __style.darkGreyColor | ||
| fontColorHover: __style.nightColor | ||
|
|
||
| onClicked: { |
There was a problem hiding this comment.
I would change the the value to null here
| || root._fieldValue === undefined | ||
| || root._fieldValue === null |
There was a problem hiding this comment.
For the future this can be replaced with ?? (nullish coalescence operator), it probably won't simplify it here
| } | ||
|
|
||
| onClearButtonClicked: { | ||
| root.editorValueChanged( root._fieldValue, true ) |
There was a problem hiding this comment.
currently the actual value doesn't change we just flag it as null no?
|
Also the the clear text is not horizontally aligned with the rest of header and the text color is wrong |
Problem
There was no way to remove value/set it as null for date field in calendar drawers. Users had to reopen the drawer by creating exactly the same point on the map for example.
Clearing the date field is causing runtime error.
Solution
Added a clear button in the drawer in header space.
Added guards which check for
undefinedandnull_fieldValuebefore assigningdateTimein calendar drawer.Behavior
Images for part 1
Video for part 1
Screencast.From.2026-06-30.17-43-27.webm