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

fixes #340 - "none" value set to null, formatValueToField checks fo… #365

Merged
merged 4 commits into from
Dec 13, 2017

Conversation

zoul0813
Copy link
Member

fixes #340 - "none" value set to null, formatValueToField checks for isNil(value) and returns null, none options are always disabled

  • updated tests to reflect "none is always disabled", could possibly be a selectOptions to allow users to select the "none" option to clear a previously selected value?
  • added formatValueToField and return null when isNil(value)

…ield checks for `isNil(value)` and returns `null`, none options are always disabled

* updated tests to reflect "none is always disabled", could possibly be a selectOptions to allow users to select the "none" option to clear a previously selected value?
* added formatValueToField and return `null` when `isNil(value)`
@zoul0813 zoul0813 requested a review from icebob December 13, 2017 18:12
@@ -1,6 +1,6 @@
<template lang="pug">
select.form-control(v-model="value", :disabled="disabled", :name="schema.inputName", :id="getFieldID(schema)", :class="schema.fieldClasses")
option(v-if="!selectOptions.hideNoneSelectedText", :disabled="schema.required", :value="null", :selected="value == undefined") {{ selectOptions.noneSelectedText || "&lt;Nothing selected&gt;" }}
option(v-if="!selectOptions.hideNoneSelectedText", :disabled="true", :value="null") {{ selectOptions.noneSelectedText || "&lt;Nothing selected&gt;" }}
Copy link
Member

Choose a reason for hiding this comment

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

I think the schema.required was a good solution, because null can be a good & valid value.

Copy link
Member Author

Choose a reason for hiding this comment

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

reverting this change back to schema.required

…into feature/340-select-none

* 'master' of https://github.com/icebob/vue-form-generator:
  fixes vue-generators#362 - `integer` validator now calls `number` validator, and returns `invalidIntegerl: "The value is not an integer"` as well as any errors generated by `number`
  fixes vue-generators#361 - use $event.target.valueAsNumber for number/range inputs, debounce `formatValueToModel` for number/range, removed `formatValueToField`

# Conflicts:
#	dist/vfg-core.js
#	dist/vfg.js
@zoul0813
Copy link
Member Author

Merged with master, bringing in changes from PR #363 and #364

@icebob
Copy link
Member

icebob commented Dec 13, 2017

Thanks. You can merge it.

@zoul0813 zoul0813 merged commit e678a72 into vue-generators:master Dec 13, 2017
@zoul0813 zoul0813 deleted the feature/340-select-none branch December 13, 2017 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fieldSelect.vue - noneSelected is not visible, required is not set
2 participants