Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

clrDate input is not emptied on model reset #3012

Closed
lg-mehdi-mhiri opened this issue Jan 10, 2019 · 5 comments · Fixed by #3050
Closed

clrDate input is not emptied on model reset #3012

lg-mehdi-mhiri opened this issue Jan 10, 2019 · 5 comments · Fixed by #3050
Assignees

Comments

@lg-mehdi-mhiri
Copy link

Describe the bug

When the model of clrDate is set to null, the input is not reset to an empty string.

How to reproduce

Stackblitz

Steps to reproduce the behavior:

  1. Select a date using the picker, or click the Today button
  2. Click on the Clear button to set the date to null
  3. The model is emptied, but the input still has the previous value

Expected behavior

The text in the input should be emptied.

Versions

App

  • Angular: 7.1.3
  • Node: 11.4.0
  • Clarity: 1.0.3

Device:

  • Type: PC
  • OS: Windows 10
  • Browser: Firefox
  • Version: 65

Additional notes

Related to #2474, but not a duplicate (that issue only concerned reactive forms)

@mathisscott
Copy link
Contributor

@coryrylan
Could you check to see if this is still an issue in 1.0.4?

@coryrylan
Copy link
Contributor

coryrylan commented Jan 11, 2019

This looks like it is an issue in 1.0.4 still. I will take a look.

@Jinnie
Copy link
Contributor

Jinnie commented Jan 14, 2019

A workaround would be to manually reset the ngModel of the input (as we're using angular form as a basis of our component).
Here's a stackblitz:
https://stackblitz.com/edit/clarity-form-reset?file=src%2Fapp%2Fapp.component.html

@coryrylan
Copy link
Contributor

Just an update, I believe I have a fix for this and will have a PR soon. Found another related bug while trying to fix this one.

coryrylan pushed a commit to coryrylan/clarity that referenced this issue Jan 16, 2019
When using clrDate, setting input to null would not
clear the input.

closes vmware-archive#3012

Signed-off-by: Cory Rylan <crylan@vmware.com>
coryrylan pushed a commit to coryrylan/clarity that referenced this issue Jan 22, 2019
When using clrDate, setting input to null would not
clear the input.

closes vmware-archive#3012

Signed-off-by: Cory Rylan <crylan@vmware.com>
coryrylan added a commit that referenced this issue Jan 22, 2019
* [NG] refactor date input, add tests

Signed-off-by: Cory Rylan <crylan@vmware.com>

* [NG] fix input reset on datepicker

When using clrDate, setting input to null would not
clear the input.

closes #3012

Signed-off-by: Cory Rylan <crylan@vmware.com>
@github-actions
Copy link

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants