@@ -21,7 +21,7 @@ import BFormValidFeedback from '../form/form-valid-feedback'
21
21
const NAME = 'BFormGroup'
22
22
23
23
// Selector for finding first input in the form-group
24
- const SELECTOR = 'input:not(: disabled),textarea:not(: disabled),select:not(: disabled)'
24
+ const SELECTOR = 'input:not([ disabled] ),textarea:not([ disabled] ),select:not([ disabled] )'
25
25
26
26
// Memoize this function to return cached values to
27
27
// save time in computed functions
@@ -338,7 +338,7 @@ export default (resolve, reject) => {
338
338
// feedback IDs if the form-group's state is explicitly valid or invalid.
339
339
return (
340
340
[ this . descriptionId , this . invalidFeedbackId , this . validFeedbackId ]
341
- . filter ( i => i )
341
+ . filter ( Boolean )
342
342
. join ( ' ' ) || null
343
343
)
344
344
}
@@ -386,11 +386,15 @@ export default (resolve, reject) => {
386
386
if ( input ) {
387
387
const adb = 'aria-describedby'
388
388
let ids = ( getAttr ( input , adb ) || '' ) . split ( / \s + / )
389
+ add = ( add || '' ) . split ( / \s + / )
389
390
remove = ( remove || '' ) . split ( / \s + / )
390
391
// Update ID list, preserving any original IDs
392
+ // and ensuring the ID's are unique
391
393
ids = ids
392
394
. filter ( id => ! arrayIncludes ( remove , id ) )
393
- . concat ( add || '' )
395
+ . concat ( add )
396
+ . filter ( Boolean )
397
+ ids = keys ( ids . reduce ( ( memo , id ) => ( { ...memo , [ id ] : true } ) , { } ) )
394
398
. join ( ' ' )
395
399
. trim ( )
396
400
if ( ids ) {
0 commit comments