Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kit): InputDateTime should format textfield value on blur #7659

Merged
merged 5 commits into from
Jun 7, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export class TuiInputDateTimeComponent
if (
this.value[0] === null ||
this.value[1] !== null ||
this.nativeValue.length <= this.fillerLength + DATE_TIME_SEPARATOR.length ||
this.nativeValue.length === this.fillerLength ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alyonagerasimova
Thanks for your contribution!

  • Could you add playwright tests for this case inside this file, please ?

    test('Good description', async ({page}) => {
        await tuiGoto(page, '/components/input-date-time/API?timeMode=HH:MM:SS.MSS');
    
        await inputDateTime.textfield.fill('07.06.2024, 23:59');
        await inputDateTime.textfield.blur();
    
        await expect(inputDateTime.textfield).toHaveValue('07.06.2024, 23:59:00.000');
    });
  • Cherry-pick your fix to main branch too, please

Copy link
Member

@nsbarsukov nsbarsukov Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you closed your previous PR to main:

Sorry for confusion.
Let's me clarify it.
We require this fix in both v3.x and main branches (2 PRs in total).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I prematurely deleted my first fork repository in order to fork it again. I will open a new PR in the main branch

Copy link
Contributor Author

@alyonagerasimova alyonagerasimova Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.timeMode === 'HH:MM'
) {
return;
Expand Down
Loading