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: line break cause textareaItem word count corrupt for iOS (#1265) #2825

Merged
merged 1 commit into from
Sep 6, 2018

Conversation

Roxyhuang
Copy link
Contributor

@Roxyhuang Roxyhuang commented Sep 5, 2018

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

@codecov
Copy link

codecov bot commented Sep 5, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@8b10644). Click here to learn what that means.
The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2825   +/-   ##
=========================================
  Coverage          ?   59.37%           
=========================================
  Files             ?       92           
  Lines             ?     2218           
  Branches          ?      635           
=========================================
  Hits              ?     1317           
  Misses            ?      895           
  Partials          ?        6
Flag Coverage Δ
#web 59.37% <42.85%> (?)
Impacted Files Coverage Δ
components/textarea-item/index.tsx 41.66% <42.85%> (ø)

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 8b10644...2d22187. Read the comment docs.

@@ -4,6 +4,7 @@ import React from 'react';
import TouchFeedback from 'rmc-feedback';
import { TextAreaItemPropsType } from './PropsType';
import { Omit } from '../_util/types';
import { IS_IOS_NOT_DEV_TOOLS } from '../_util/exenv';
Copy link
Contributor

Choose a reason for hiding this comment

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

用 IsIOS 不可以么

Copy link
Contributor Author

Choose a reason for hiding this comment

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

桌面devtools模拟ios会有问题,这个针对真机的一个bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#1265 里我有提及原因,可以使用真机测试一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

可能描述的不清晰,我补充一下,该问题只有在iOS真机下maxlength会出现问题,使用浏览器的devtools并不会出现,因此需要做特殊处理判断不是devtools模拟的,否则devtools模拟会出问题

Copy link
Contributor

Choose a reason for hiding this comment

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

@ziluo 看一下有没有必要加这一个。影响范围是 dev-tools

Copy link
Contributor

Choose a reason for hiding this comment

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

@ziluo 你看看需不需要加上这个变量,dev-tools 需不需要照顾到

Copy link
Contributor

Choose a reason for hiding this comment

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

暂不考虑dev-tools

Copy link
Contributor Author

@Roxyhuang Roxyhuang Sep 6, 2018

Choose a reason for hiding this comment

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

@doxiaodong 需要我close之后,修改后再提PR吗? 如果不判断在dev-tools的iOS的情况下,整个maxLength的限制会失效哦

Copy link
Contributor

@doxiaodong doxiaodong Sep 6, 2018

Choose a reason for hiding this comment

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

@Roxyhuang 你直接改成 IsIOS 呀,不需要 close,不过可以加一条注释说明

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@doxiaodong 可以了,麻烦review一下,谢谢

@Roxyhuang Roxyhuang force-pushed the fix-textarea-item-count branch from 1b34bb9 to d24df2f Compare September 6, 2018 07:51
@Roxyhuang Roxyhuang force-pushed the fix-textarea-item-count branch from d24df2f to 2d22187 Compare September 6, 2018 08:00
Copy link
Contributor

@doxiaodong doxiaodong left a comment

Choose a reason for hiding this comment

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

@doxiaodong doxiaodong merged commit 808c6dc into ant-design:master Sep 6, 2018
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.

3 participants