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

[Bug Report] Form reset should set value to null #7429

Closed
Djaler opened this issue Jun 7, 2019 · 8 comments
Closed

[Bug Report] Form reset should set value to null #7429

Djaler opened this issue Jun 7, 2019 · 8 comments
Assignees
Labels
C: VForm VForm T: enhancement Functionality that enhances existing features
Milestone

Comments

@Djaler
Copy link
Contributor

Djaler commented Jun 7, 2019

Versions and Environment

Vuetify: 1.5.14
Vue: 2.6.10
Browsers: Chrome 75.0.3770.80
OS: Linux x86_64

Steps to reproduce

Press "Reset" button

Expected Behavior

Resetting form should set input value to null (according to docs)

Actual Behavior

Resetting form set input value to undefined

Reproduction Link

https://codepen.io/anon/pen/zQVmob?editors=1010#0

@ghost ghost added the S: triage label Jun 7, 2019
@KaelWD
Copy link
Member

KaelWD commented Jun 9, 2019

reset() uses undefined:

reset () {
this.isResetting = true
this.internalValue = Array.isArray(this.internalValue)
? []
: undefined
},

click:clear uses null:

clearableCallback () {
this.internalValue = null
this.$nextTick(() => this.$refs.input.focus())
},

See also #4144 and #2752

@KaelWD KaelWD added C: VTextField VTextField T: enhancement Functionality that enhances existing features and removed S: triage labels Jun 9, 2019
@Djaler
Copy link
Contributor Author

Djaler commented Jun 9, 2019

image
So either this is a bug in the code or in the documentation.

@Djaler
Copy link
Contributor Author

Djaler commented Nov 1, 2019

@KaelWD so what about it? ^

@bad4iz bad4iz added C: VForm VForm and removed C: VTextField VTextField labels Jan 15, 2020
@Djaler
Copy link
Contributor Author

Djaler commented Apr 26, 2020

This is still relevant

@Djaler
Copy link
Contributor Author

Djaler commented Apr 26, 2020

With current behaviour it is really ugly to use data with typescript, cause you should consider both undefined and null in type definition

@Djaler
Copy link
Contributor Author

Djaler commented Jul 7, 2020

Is anybody here?

@arcreative
Copy link

@KaelWD So is that the end of it? Why were these both closed as duplicates of each other without explanation?

@arcreative
Copy link

@KaelWD nevermind, I see #12373 now, thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VForm VForm T: enhancement Functionality that enhances existing features
Projects
None yet
Development

No branches or pull requests

4 participants