Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cascader): support aria #1657

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
20 changes: 14 additions & 6 deletions src/cascader/cascader.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
</view>
<view class="{{name}}__close-btn" bind:tap="hide">
<slot name="close-btn" />
<t-icon wx:if="{{closeBtn}}" size="24" name="close" />
<t-icon wx:if="{{closeBtn}}" aria-role="button" aria-label="关闭" size="24" name="close" />
</view>
<view class="{{name}}__content">
<block wx:if="{{steps && steps.length}}">
<view wx:if="{{theme == 'step'}}" class="{{name}}__steps">
<view wx:for="{{steps}}" wx:key="index" class="{{name}}__step" bind:tap="onStepClick" data-index="{{index}}">
<view
wx:for="{{steps}}"
wx:key="index"
class="{{name}}__step"
bind:tap="onStepClick"
data-index="{{index}}"
aria-role="{{ item === defaultOptionLabel ? 'text' : 'button' }}"
zhangpaopao0609 marked this conversation as resolved.
Show resolved Hide resolved
aria-label="{{ item === defaultOptionLabel ? item : '已选中,' + item }}"
>
<view
class="{{name}}__step-dot {{name}}__step-dot--{{item !== defaultOptionLabel ? 'active' : ''}} {{name}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}"
></view>
Expand All @@ -29,9 +37,9 @@
</t-tabs>
</block>
</block>
<view wx:if="{{ subTitles && subTitles[stepIndex] }}" class="{{name}}__options-title"
>{{subTitles[stepIndex]}}</view
>
<view wx:if="{{ subTitles && subTitles[stepIndex] }}" class="{{name}}__options-title">
{{subTitles[stepIndex]}}
</view>
<view
class="{{name}}__options-container"
style="width: {{items.length + 1}}00vw; transform: translateX(-{{stepIndex}}00vw)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个style去掉了,符合预期吗

Expand All @@ -44,7 +52,7 @@
scroll-y
scroll-top="{{scrollTopList[index]}}"
>
<view class="cascader-radio-group-{{index}}">
<view class="cascader-radio-group-{{index}}" aria-hidden="{{ stepIndex !== index}}">
<t-radio-group
value="{{selectedValue[index]}}"
keys="{{keys}}"
Expand Down