Skip to content

Commit

Permalink
fix(b-form-group): remove role="alert" from valid/invalid feedback (c…
Browse files Browse the repository at this point in the history
…loses #6300, #6307) (#6346)

* fix(b-form-group): remove `role="alert"` from valid/invalid feedback

* Update form-group.spec.js

Co-authored-by: Hiws <hiws@live.dk>
  • Loading branch information
jacobmllr95 and Hiws authored Feb 2, 2021
1 parent 05b8ffd commit c0959c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/components/form-group/form-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ export const BFormGroup = {
props: {
ariaLive: feedbackAriaLive,
id: invalidFeedbackId,
role: feedbackAriaLive ? 'alert' : null,
// If state is explicitly `false`, always show the feedback
state,
tooltip
Expand All @@ -326,7 +325,6 @@ export const BFormGroup = {
props: {
ariaLive: feedbackAriaLive,
id: validFeedbackId,
role: feedbackAriaLive ? 'alert' : null,
// If state is explicitly `true`, always show the feedback
state,
tooltip
Expand Down
4 changes: 0 additions & 4 deletions src/components/form-group/form-group.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,12 @@ describe('form-group', () => {
const $invalidFeedback = wrapper.find('.invalid-feedback')
expect($invalidFeedback.exists()).toBe(true)
expect($invalidFeedback.text()).toEqual('bar')
expect($invalidFeedback.attributes('role')).toEqual('alert')
expect($invalidFeedback.attributes('aria-live')).toEqual('assertive')
expect($invalidFeedback.attributes('aria-atomic')).toEqual('true')

const $validFeedback = wrapper.find('.valid-feedback')
expect($validFeedback.exists()).toBe(true)
expect($validFeedback.text()).toEqual('baz')
expect($validFeedback.attributes('role')).toEqual('alert')
expect($validFeedback.attributes('aria-live')).toEqual('assertive')
expect($validFeedback.attributes('aria-atomic')).toEqual('true')

Expand Down Expand Up @@ -373,14 +371,12 @@ describe('form-group', () => {
let $invalidFeedback = wrapper.find('.invalid-feedback')
expect($invalidFeedback.exists()).toBe(true)
expect($invalidFeedback.text()).toEqual('bar')
expect($invalidFeedback.attributes('role')).toEqual('alert')
expect($invalidFeedback.attributes('aria-live')).toEqual('polite')
expect($invalidFeedback.attributes('aria-atomic')).toEqual('true')

let $validFeedback = wrapper.find('.valid-feedback')
expect($validFeedback.exists()).toBe(true)
expect($validFeedback.text()).toEqual('baz')
expect($validFeedback.attributes('role')).toEqual('alert')
expect($validFeedback.attributes('aria-live')).toEqual('polite')
expect($validFeedback.attributes('aria-atomic')).toEqual('true')

Expand Down

0 comments on commit c0959c4

Please sign in to comment.