Skip to content

[Bug]: sbbTimeInput does not format input value (e.g. '1525' → '15:25') on form submit #2516

@cgaertnerBern

Description

@cgaertnerBern

Preflight Checklist

Bug type

Functionality

Which version are you using

19.0.0

Operating system

Windows 11

Browser / Browser version

Firefox 138.0.1 (it applies to all browsers)

Input mode

Mouse/Keyboard

Additional settings

No response

What happened?

We have a reactive form with (ngSubmit) configured. When we assign a value to the sbbTimeInput field and then press Enter, the value we get in the form is not formatted. That is, if we enter '1525', the value in the form remains ?'1525' instead of being formatted as '15:25', which would be desirable.

What did you expect to happen?
The expected behavior would be that when entering an unformatted time value, such as '1525', and pressing Enter, the form field should have the value '15:25' assigned.

What happened instead?
Currently, when we enter '1525' in the field and press Enter, the form field is assigned the value '1525'.

What would you like to see changed?
See the expected behaviour description.

Is the issue related to a specific component?
The sbbTimeInput directive.

Here is a demo where we can reproduce the problem: sbbTimeInput blur problem

Image

Steps to reproduce the issue

Having a reactive form with ngSubmit configured:

  1. Enter '1525' in the sbbTimeInput field
  2. Press Enter
  3. The form field value remains '1525' instead of being formatted as '15:25'

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Bugs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions