Skip to content

Commit

Permalink
fix(rate): 优化读取.(#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
byq1213 committed Feb 23, 2023
1 parent adf502d commit edbf9fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/rate/rate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Rate extends SuperComponent {
tipsLeft: 0,
actionType: '',
scaleIndex: -1,
isChange: false,
isVisibleToScreenReader: false,
};

methods = {
Expand Down Expand Up @@ -71,11 +71,11 @@ export default class Rate extends SuperComponent {
onTouchMove(e: WechatMiniprogram.TouchEvent) {
this.onTouch(e, 'move');
this.setData({
isChange: true,
isVisibleToScreenReader: true,
});
setTimeout(() => {
this.setData({
isChange: false,
isVisibleToScreenReader: false,
});
}, 2e3);
},
Expand Down
4 changes: 2 additions & 2 deletions src/rate/rate.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
/>
</view>
<text
wx:if="{{showText||isChange}}"
wx:if="{{showText||isVisibleToScreenReader}}"
class="{{_.cls(classPrefix + '__text', [['active', value > 0], ['sr-only', !showText]])}} {{prefix}}-class-text"
aria-role="alert"
aria-live="assertive"
>{{utils.getText(texts,value,defaultTexts)}}{{allowHalf?value+'星':''}}</text
>{{utils.getText(texts,value,defaultTexts)}}</text
>
<view wx:if="{{tipsVisible}}" class="{{classPrefix}}__tips" style="left: {{tipsLeft}}px" aria-hidden="true">
<block wx:if="{{actionType == 'tap'}}">
Expand Down

0 comments on commit edbf9fe

Please sign in to comment.