1
0
mirror of synced 2024-11-22 21:36:04 +03:00

Fixes limitation of name values

This commit is contained in:
Justin Schroeder 2020-05-04 14:57:47 -04:00
parent 45711c581a
commit 637e5afe54
2 changed files with 4 additions and 12 deletions

View File

@ -54,7 +54,9 @@ export default {
methods: { methods: {
groupItemContext (context, option, groupAttributes) { groupItemContext (context, option, groupAttributes) {
const optionAttributes = {} const optionAttributes = {}
const ctx = Object.assign({}, context, option, groupAttributes, optionAttributes) const ctx = Object.assign({}, context, option, groupAttributes, optionAttributes, !context.hasGivenName ? {
name: true
} : {})
return ctx return ctx
} }
} }

View File

@ -164,17 +164,7 @@ function nameOrFallback () {
* determine if an input has a user-defined name * determine if an input has a user-defined name
*/ */
function hasGivenName () { function hasGivenName () {
if ( return typeof this.name !== 'boolean'
this.name &&
typeof this.name === 'string' &&
this.name !== `${this.type}_${this.id}` &&
this.name !== `${this.type}_${this.defaultId}` &&
// radio and checkbox options have their value as part of their ID so we need to filter those out too
this.name !== `${this.type}_${(String(this.id).replace('_' + String(this.value), ''))}`
) {
return true
}
return false
} }
/** /**