react-component / textarea

React Textarea
MIT License
26 stars 35 forks source link

style: use ant-input-affix-wrapper-focused when focused #36

Closed MuxinFeng closed 1 year ago

MuxinFeng commented 1 year ago

close https://github.com/ant-design/ant-design/issues/41164

MuxinFeng commented 1 year ago

pr 效果: 给 textarea 加上获取焦点时的样式。

修复思路:

  1. 在组件有 wrapper 包裹时,border 样式会在 wrapper 上实现,而 textarea 本身的 boder 会被设置为 none; image

  2. 如何让 wrapper 获得样式,是在 rc-input、rc-textarea内部实现的,更精确的来说是 BaseInput 实现的 image

  3. rc-input 在对 BaseInput 封装的时候,会传入 focused 判断是否要加这个样式,而 rc-textarea 漏掉了这个步骤,所以本次 pr 按照 rc-input 那边加了一下。

MadCcc commented 1 year ago

需要测试用例

MadCcc commented 1 year ago

可以试一下改 BaseInput,直接把 onFocus 和 onBlur 代理掉

codecov[bot] commented 1 year ago

Codecov Report

Merging #36 (8b8b472) into master (6bd07f4) will increase coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Current head 8b8b472 differs from pull request most recent head bcbbba8. Consider uploading reports for the commit bcbbba8 to get more accurate results

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   98.98%   99.01%   +0.02%     
==========================================
  Files           3        3              
  Lines         198      203       +5     
  Branches       61       62       +1     
==========================================
+ Hits          196      201       +5     
  Misses          2        2              
Impacted Files Coverage Δ
src/TextArea.tsx 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

MuxinFeng commented 1 year ago

可以试一下改 BaseInput,直接把 onFocus 和 onBlur 代理掉

没太懂这里的意思诶,是对现有写法的优化吗;上面提到的都改完了,麻烦大佬再看看~

MadCcc commented 1 year ago

v4 要在 antd 的 4.x-stable 分支上改

MuxinFeng commented 1 year ago

v4 要在 antd 的 4.x-stable 分支上改

好嘞,我给 antd 4.x 的 rc-textarea 升到最新试试