Skip to content

Commit

Permalink
Aria search (Tencent#1132)
Browse files Browse the repository at this point in the history
* feat: aria-search

* feat: aria-search

* test: aria-search

Co-authored-by: chongliang <chongliang@tencent.com>
  • Loading branch information
Isabella327 and chongliang authored Nov 29, 2022
1 parent 32a797f commit 8629fcd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
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

0 comments on commit 8629fcd

Please sign in to comment.