Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(b-progress-bar): add ariaLabel prop#7202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
grchng wants to merge1 commit intobootstrap-vue:dev
base:dev
Choose a base branch
Loading
fromgrchng:progress-bar/add-ariaLabel-prop
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletionsrc/components/progress/progress-bar.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@ export const props = makePropsConfigurable(
animated: makeProp(PROP_TYPE_BOOLEAN, null),
label: makeProp(PROP_TYPE_STRING),
labelHtml: makeProp(PROP_TYPE_STRING),
ariaLabel: makeProp(PROP_TYPE_STRING, 'progress-bar'),
max: makeProp(PROP_TYPE_NUMBER_STRING, null),
precision: makeProp(PROP_TYPE_NUMBER_STRING, null),
showProgress: makeProp(PROP_TYPE_BOOLEAN, null),
Expand DownExpand Up@@ -99,7 +100,7 @@ export const BProgressBar = /*#__PURE__*/ extend({
}
},
render(h) {
const { label, labelHtml, computedValue, computedPrecision } = this
const {ariaLabel,label, labelHtml, computedValue, computedPrecision } = this

let $children
let domProps = {}
Expand All@@ -121,6 +122,7 @@ export const BProgressBar = /*#__PURE__*/ extend({
style: this.progressBarStyles,
attrs: {
role: 'progressbar',
'aria-label': ariaLabel,
'aria-valuemin': '0',
'aria-valuemax': toString(this.computedMax),
'aria-valuenow': toFixed(computedValue, computedPrecision)
Expand Down
12 changes: 12 additions & 0 deletionssrc/components/progress/progress-bar.spec.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -267,4 +267,16 @@ describe('progress-bar', () => {

wrapper.destroy()
})

it('has aria-label attribute when explicitly set', () => {
const wrapper = mount(BProgressBar, {
attrs: {
'aria-label': 'ariaLabel'
}
})

expect(wrapper.attributes('aria-label')).toBe('ariaLabel')

wrapper.destroy()
})
})
2 changes: 1 addition & 1 deletionsrc/components/progress/progress.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ import { BProgressBar, props as BProgressBarProps } from './progress-bar'

// --- Props ---

const progressBarProps = omit(BProgressBarProps, ['label', 'labelHtml'])
const progressBarProps = omit(BProgressBarProps, ['ariaLabel', 'label', 'labelHtml'])

export const props = makePropsConfigurable(
sortKeys({
Expand Down
2 changes: 2 additions & 0 deletionssrc/components/progress/progress.spec.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,7 @@ describe('progress', () => {
const $bar = wrapper.find('.progress-bar')
expect($bar.element.tagName).toBe('DIV')
expect($bar.attributes('role')).toBe('progressbar')
expect($bar.attributes('aria-label')).toBe('progress-bar')
expect($bar.attributes('aria-valuemin')).toBe('0')
expect($bar.attributes('aria-valuemax')).toBe('100')
expect($bar.attributes('aria-valuenow')).toBe('0')
Expand DownExpand Up@@ -55,6 +56,7 @@ describe('progress', () => {
const $bar = wrapper.find('.progress-bar')
expect($bar.element.tagName).toBe('DIV')
expect($bar.attributes('role')).toBe('progressbar')
expect($bar.attributes('aria-label')).toBe('progress-bar')
expect($bar.attributes('aria-valuemin')).toBe('0')
expect($bar.attributes('aria-valuemax')).toBe('50')
expect($bar.attributes('aria-valuenow')).toBe('25')
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp