1
0
mirror of synced 2024-11-29 00:26:12 +03:00

Update src/libs/context.js

Co-authored-by: Justin Schroeder <justin@wearebraid.com>
This commit is contained in:
Andrew Boyd 2020-05-02 09:30:26 -04:00 committed by GitHub
parent 1a334f9a9e
commit bdbf2afc8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,17 +164,7 @@ function nameOrFallback () {
* determine if an input has a user-defined name
*/
function hasGivenName () {
if (
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
return typeof this.name !== 'boolean'
}
/**