Skip to content

[IMP] shopfloor_mobile_base: allow user input in date-picker-input + code cleanup#1132

Open
nicolas-delbovier-acsone wants to merge 7 commits intoOCA:16.0from
acsone:16.0-ref-shopfloor_mobile_base-new-date_picker_input
Open

[IMP] shopfloor_mobile_base: allow user input in date-picker-input + code cleanup#1132
nicolas-delbovier-acsone wants to merge 7 commits intoOCA:16.0from
acsone:16.0-ref-shopfloor_mobile_base-new-date_picker_input

Conversation

@nicolas-delbovier-acsone
Copy link

@nicolas-delbovier-acsone nicolas-delbovier-acsone commented Feb 17, 2026

This PR is a rework of the ideas in #1101. It addresses a double-trigger bug observed when using a watch on the date property, replacing it with an explicit event-driven approach.

Changes

Input Handling (UX)

  • Dynamic masking: automatically enter separator characters to improve typing
  • Locale-aware parsing: enables to use the date string format of the user's language
  • Input validation: prevent user from entering invalid characters and check if provided date is valid

Architectural Refactoring (Cleanup)

  • Remove 'datepicker:newdate' event from event hub since it is never used and not necessary
  • Remove handler_to_update_date function since dealing with date transformation should be the responsability of the parent
  • Eliminated Redundant Watchers: Removed the date watcher in favor of explicit $emit calls during change events. This prevents redundant triggers that were observed in [16.0][IMP] shopfloor_mobile_base: Improves date-picker UX #1101.

Refactor the DatePicker component to use standard Vue event bubbling
instead of a global event hub and watchers.

- Replace the 'date' watcher with a manual $emit on the '@change'
  event to prevent redundant event triggers and improve performance.
- Remove the 'datepicker:newdate' event_hub listener as global
  broadcasting is unnecessary for this local UI component.
- Remove the 'handler_to_update_date' prop, shifting the responsibility
  of date processing to the parent component.
- Simplify the template and remove unused imports.
…g keyboard

- Use user locale for date input
- Use input masking to auto add the separators
- Prevent from entering invalid characters
- Show input error message in case of invalid input
- Reset input if date-picker is used instead
@OCA-git-bot
Copy link
Contributor

Hi @simahawk,
some modules you are maintaining are being modified, check this out!

Changed the date-picker-input behavior to trigger the calendar popup
only when the prepend icon is clicked, rather than on text field focus.

This prevents the picker from obstructing the screen when users prefer
to type the date manually

Co-authored-by: Jacques-Etienne Baudoux <je.baudoux@gmail.com>
nicolas-delbovier-acsone added a commit to acsone/wms that referenced this pull request Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants