Skip to content

Commit

Permalink
Fix#3000 and Fix inputItem make Picker unable to click in Wechat with…
Browse files Browse the repository at this point in the history
… IOS12; (#3017)

* fix ios wechat inputItem with Picker;

* fix #3000 issue in input-item,search-bar,textarea-item;
  • Loading branch information
thewindsword authored and doxiaodong committed Mar 20, 2019
1 parent cd3d06e commit 9359453
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/input-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ class InputItem extends React.Component<InputItemProps, any> {
}, 200);
}
if (this.props.onBlur) {
// fix autoFocus item blur with flash
setTimeout(() => {
// fix ios12 wechat browser click failure after input
if (document.body) {
document.body.scrollTop = document.body.scrollTop;
}
},100);
this.props.onBlur(value);
}
}
Expand Down
7 changes: 7 additions & 0 deletions components/search-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ export default class SearchBar extends React.Component<
this.blurFromOnClear = false;
});
if (this.props.onBlur) {
// fix autoFocus item blur with flash
setTimeout(() => {
// fix ios12 wechat browser click failure after input
if (document.body) {
document.body.scrollTop = document.body.scrollTop;
}
},100);
this.props.onBlur();
}
}
Expand Down
7 changes: 7 additions & 0 deletions components/textarea-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ export default class TextareaItem extends React.Component<
}, 100);
const value = e.currentTarget.value;
if (this.props.onBlur) {
// fix autoFocus item blur with flash
setTimeout(() => {
// fix ios12 wechat browser click failure after input
if (document.body) {
document.body.scrollTop = document.body.scrollTop;
}
},100);
this.props.onBlur(value);
}
}
Expand Down

0 comments on commit 9359453

Please sign in to comment.