-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix search bar #1621
Fix search bar #1621
Conversation
@pingan1927, thanks for your PR! By analyzing the history of the files in this pull request, we identified @warmhug, @yiminghe and @silentcloud to be potential reviewers. |
components/search-bar/index.web.tsx
Outdated
(this.refs as any).searchInput.focus(); | ||
this.componentDidUpdate(); | ||
}, 300); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 if else 怪怪的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈,我也觉得怪怪地,更优雅的写法有吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测测没问题就好。 只是这种写 alipay agent 特殊代码的做法 能少还是少点好。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用 guard clauses 呀。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const ua = navigator.userAgent;
if (ua.indexOf('AlipayClient') >= 0 && (ua.match(/Android/i) || ua.indexOf('AM') < 0)) {
// xxx
}
Codecov Report
@@ Coverage Diff @@
## master #1621 +/- ##
==========================================
- Coverage 66.19% 66.16% -0.03%
==========================================
Files 228 228
Lines 4423 4425 +2
Branches 1157 1158 +1
==========================================
Hits 2928 2928
- Misses 1494 1496 +2
Partials 1 1
Continue to review full report at Codecov.
|
components/search-bar/index.web.tsx
Outdated
(this.refs as any).searchInput.focus(); | ||
this.componentDidUpdate(); | ||
}, 300); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测测没问题就好。 只是这种写 alipay agent 特殊代码的做法 能少还是少点好。
* fix ant-design#1609 * update search-bar doc * optimize code * optimize code
* fix ant-design#1609 * update search-bar doc * optimize code * optimize code
ref #1609
First of all, thank you for your contribution! :-)
Please makes sure that these checkboxes are checked before submitting your PR, thank you!
npm run lint
and fix those errors before submitting in order to keep consistent code style.Extra checklist:
if isBugFix :
elif isNewFeature :
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)