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

Fix search bar #1621

Merged
merged 4 commits into from
Jul 28, 2017
Merged

Fix search bar #1621

merged 4 commits into from
Jul 28, 2017

Conversation

pingan1927
Copy link
Contributor

@pingan1927 pingan1927 commented Jul 28, 2017

ref #1609
First of all, thank you for your contribution! :-)

Please makes sure that these checkboxes are checked before submitting your PR, thank you!

  • Make sure that you follow antd's code convention.
  • Run npm run lint and fix those errors before submitting in order to keep consistent code style.
  • Rebase before creating a PR to keep commit history clear.
  • Add some descriptions and refer relative issues for you PR.

Extra checklist:

if isBugFix :

  • Make sure that you add at least one unit test for the bug which you had fixed.

elif isNewFeature :

  • Update API docs for the component.
  • Update/Add demo to demonstrate new feature.
  • Update TypeScript definition for the component.
  • Add unit tests for the feature.

This change is Reviewable

@mention-bot
Copy link

@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.

(this.refs as any).searchInput.focus();
this.componentDidUpdate();
}, 300);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 if else 怪怪的。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈哈,我也觉得怪怪地,更优雅的写法有吗?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测测没问题就好。 只是这种写 alipay agent 特殊代码的做法 能少还是少点好。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 guard clauses 呀。

Copy link
Member

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
Copy link

codecov bot commented Jul 28, 2017

Codecov Report

Merging #1621 into master will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#rn 65.59% <ø> (ø) ⬆️
#web 66.72% <66.66%> (-0.06%) ⬇️
Impacted Files Coverage Δ
components/search-bar/index.web.tsx 77.22% <66.66%> (-1.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c47996...a211e57. Read the comment docs.

(this.refs as any).searchInput.focus();
this.componentDidUpdate();
}, 300);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测测没问题就好。 只是这种写 alipay agent 特殊代码的做法 能少还是少点好。

@pingan1927 pingan1927 merged commit bf776cb into master Jul 28, 2017
marswong pushed a commit to marswong/ant-design-mobile that referenced this pull request Jul 28, 2017
* fix ant-design#1609

* update search-bar doc

* optimize code

* optimize code
@paranoidjk paranoidjk deleted the fix-search-bar branch July 28, 2017 10:16
lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this pull request Apr 26, 2018
* fix ant-design#1609

* update search-bar doc

* optimize code

* optimize code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants