Skip to content

modus-time-picker.formatter Auto Format can be actively unhelpful #3421

@AllanTaylor314

Description

@AllanTaylor314

Prerequisites

Describe the issue

The auto-formatter makes entering a time more difficult than a simple text box would. Typing 10: into a time picker results in 10:: which means that trying to enter 10:42 results in 10::4 (and then using arrow keys changes table focus, but that's a separate thing).

Also, autoFormatTimeInput has no tests. I have some suggested tests and my expected/preferred output

Image

The biggest thing to fix would be 12:: to 12: and the next would be 9: to 09:

Reduced test cases

Type 10:42 into a time-picker with auto-format=true (we use a 24 hour picker)
Expected 10:42
Got 10::4 (or for a 12 hour picker, 10::4 2M)

When the field is 10, it should autoformat to 10: and typing another colon should still result in 10:

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What is the issue regarding ?

@trimble-oss/modus-web-components

What version of npm package are you using ?

v1.8.0 (also present in v1.8.1 on storybook)

Priority

Low

What product/project are you using Modus Components for ?

WorksManager

What is your team/division name ?

CCFS-CS/Weka

Are you willing to contribute ?

Yes

Are you using Modus Web Components in production ?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is wrong and needs to be addressedexternal-requestBugs and features reported by individuals from other teams in Trimble

    Type

    No type

    Projects

    Status

    In Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions