Skip to content

Commit

Permalink
feat(progress): support progress aria (#1156)
Browse files Browse the repository at this point in the history
* feat(progress): support progress aria

fix #1049

* fix(progress): add props

add props
  • Loading branch information
yaogengzhu authored Dec 5, 2022
1 parent d45fa21 commit 34d9fcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/src/instantiationDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const toComponent = function toComponent(options: Record<string, any>) {
{ key: 'ariaHidden', type: Boolean },
{ key: 'ariaRole', type: String },
{ key: 'ariaLabel', type: String },
{ key: 'ariaLabelledby', type: String },
{ key: 'ariaDescribedby', type: String },
{ key: 'ariaBusy', type: Boolean },
];
ariaProps.forEach(({ key, type }) => {
options.properties[key] = {
Expand Down
9 changes: 9 additions & 0 deletions src/progress/progress.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<view style="{{ customStyle }}" class="{{ classPrefix }} {{classPrefix}}--status--{{status || computedStatus}}">
<view class="{{ classPrefix }}__inner {{prefix}}-class">
<view
aria-role="progressbar"
role="progressbar"
aria-valuenow="{{computedProgress}}"
aria-valuemin="0"
aria-valuemax="100"
aria-label="{{ ariaLabel }}"
aria-labelledby="{{ ariaLabelledby }}"
aria-describedby="{{ ariaDescribedby }}"
aria-busy="{{ ariaBusy }}"
class="{{ classPrefix }}__bar {{prefix}}-class-bar"
style="height: {{ heightBar }}; background: {{ trackColor }}"
>
Expand Down

0 comments on commit 34d9fcc

Please sign in to comment.