From 3f5872c3fc08c7b24319034e5eab598bd1c4d729 Mon Sep 17 00:00:00 2001 From: Jeff Sagal Date: Mon, 2 Dec 2019 13:30:52 -0800 Subject: [PATCH] docs(resetOnOptionsChange): add versioning info (#1020) * docs(resetOnOptionsChange): update documentation Related #1015 * docs(resetOnOptionsChange): add versioning info --- docs/api/props.md | 8 +++++--- src/components/Select.vue | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/api/props.md b/docs/api/props.md index 5050c76..2ae8284 100644 --- a/docs/api/props.md +++ b/docs/api/props.md @@ -339,9 +339,11 @@ createOption: { ## resetOnOptionsChange -When false, updating the options will not reset the selected value. Accepts -a `boolean` or `function` that returns a `boolean`. If defined as a function, -it will receive the params listed below. +When false, updating the options will not reset the selected value. + +Since `v3.4+` the prop accepts either a `boolean` or `function` that returns a `boolean`. + +If defined as a function, it will receive the params listed below. ```js /** diff --git a/src/components/Select.vue b/src/components/Select.vue index adcd6a4..f5b41a0 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -412,6 +412,9 @@ * When false, updating the options will not reset the selected value. Accepts * a `boolean` or `function` that returns a `boolean`. If defined as a function, * it will receive the params listed below. + * + * @since 3.4 - Type changed to {Boolean|Function} + * * @type {Boolean|Function} * @param {Array} newOptions * @param {Array} oldOptions @@ -522,7 +525,7 @@ let shouldReset = () => typeof this.resetOnOptionsChange === 'function' ? this.resetOnOptionsChange(newOptions, oldOptions, this.selectedValue) : this.resetOnOptionsChange; - + if (!this.taggable && shouldReset()) { this.clearSelection(); }