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

Aria search #1132

Merged
merged 3 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion src/search/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`search Props :base 1`] = `
class="t-icon t-class-left"
>
<wx-view
ariaHidden="{{false}}"
ariaHidden="{{true}}"
ariaLabel=""
ariaRole=""
class="t-icon t-class"
Expand Down Expand Up @@ -45,6 +45,7 @@ exports[`search Props :base 1`] = `
/>
</wx-view>
<wx-view
ariaRole="button"
class="t-search__search-action t-class-action"
bind:tap="onActionClick"
>
Expand Down
23 changes: 20 additions & 3 deletions src/search/search.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
>
<!-- <view wx:if="{{label}}" class="{{classPrefix}}__label {{prefix}}-class-label">{{label}}</view>
<slot name="label" /> -->
<t-icon wx:if="{{leftIcon}}" name="{{leftIcon}}" size="24" class="{{prefix}}-icon {{prefix}}-class-left" />
<t-icon
wx:if="{{leftIcon}}"
name="{{leftIcon}}"
size="24"
class="{{prefix}}-icon {{prefix}}-class-left"
aria-hidden="{{true}}"
/>
<slot name="left-icon" />
<input
type="text"
Expand All @@ -21,7 +27,13 @@
bind:blur="onBlur"
bind:confirm="onConfirm"
/>
<view wx:if="{{value !==''}}" class="{{classPrefix}}__right {{prefix}}-class-right" bind:tap="handleClear">
<view
wx:if="{{value !==''}}"
class="{{classPrefix}}__right {{prefix}}-class-right"
bind:tap="handleClear"
aria-role="button"
aria-label="清除"
>
<t-icon
wx:if="{{rightIcon}}"
name="{{rightIcon}}"
Expand All @@ -32,7 +44,12 @@
<slot name="right-icon" />
</view>
</view>
<view wx:if="{{action}}" class="{{classPrefix}}__search-action {{prefix}}-class-action" bindtap="onActionClick">
<view
wx:if="{{action}}"
class="{{classPrefix}}__search-action {{prefix}}-class-action"
bindtap="onActionClick"
aria-role="button"
>
{{action}}
</view>
<slot name="action-text" />
Expand Down