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

同时使用使用 Datepicker Select 时没有对齐 #3481

Closed
daysv opened this issue Oct 19, 2016 · 5 comments
Closed

同时使用使用 Datepicker Select 时没有对齐 #3481

daysv opened this issue Oct 19, 2016 · 5 comments
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@daysv
Copy link

daysv commented Oct 19, 2016

发生问题的环境是:

  • antd 版本: 2.1.0
  • 操作系统及其版本: win7 x64
  • 浏览器及其版本: chrome 53.0.2785.143 m

您做了什么?

同时使用 Datepicker Select

您期待的结果是:

两个组件对齐

实际上的结果是:

两个控件没有对齐, 需要在DatePicker 中增加 verticalAlign: 'middle'样式进行修复

可重现的在线演示

http://codepen.io/daysv/pen/BLqbxw

@benjycui
Copy link
Contributor

Select 是有 vertical-align: middle 的,DatePicker 应该是忘了加。

@afc163 afc163 reopened this Oct 19, 2016
@afc163
Copy link
Member

afc163 commented Oct 19, 2016

这个我来改,Select 不应该 vertical-align: middle

@afc163 afc163 self-assigned this Oct 19, 2016
@afc163 afc163 added 🐛 Bug Ant Design Team had proved that this is a bug. Style labels Oct 19, 2016
@afc163
Copy link
Member

afc163 commented Oct 19, 2016

  1. Select 去掉 vertical-align: middle,保持和 Input、DatePicker 等一致的默认 vertical-align: baseline

  2. vertical-align: baseline 是按照 Select 内部自然排版的文本进行对齐,由于 Select 内部的 placeholder 和搜索框都是绝对定位(无法对齐),这里使用了一个小技巧,通过给内部补充一个始终存在的文本来对齐。

    .ant-select-selection--single .ant-select-selection__rendered::after {
      content: '.';
      visibility: hidden;
      pointer-events: none;
    }
  3. .ant-select-selection__renderedoverflow: hidden 会影响文本对齐,去掉。

  4. 去掉后会破坏原来的文本溢出省略号效果,一一予以修正。

  5. 进一步连带修复被破坏的 combobox。


涉及非常多的样式细节...

@afc163
Copy link
Member

afc163 commented Oct 19, 2016

另外还修复了多选 select 的 small/large 样式。

@lock
Copy link

lock bot commented May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants