Skip to content

fix(transfer): checkbox click evt run repeatedly #6903

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

Merged
merged 2 commits into from
Sep 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/transfer/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@
&-footer {
border-top: @border-width-base @border-style-base @border-color-split;
}

&-checkbox {
line-height: 1;
align-items: center;

.ant-checkbox {
Copy link
Member

Choose a reason for hiding this comment

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

这里直接写死了 ant 前缀

Copy link
Member Author

Choose a reason for hiding this comment

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

因为好像那里用的是组件,然后有个 top 属性,我只能这样重置了。

Copy link
Member

Choose a reason for hiding this comment

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

啊 这不对啊,用的组件也是支持自定义的啊

Copy link
Member Author

Choose a reason for hiding this comment

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

我再看看

Copy link
Member Author

Choose a reason for hiding this comment

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

4.x 那个应该是没问题的,我给 antd 也提了 pr,合了

Copy link
Member Author

Choose a reason for hiding this comment

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

<li
  ...
>
  <Checkbox
    class={`${prefixCls}-checkbox`}
    checked={checked}
    disabled={disabled || item.disabled}
  />
  {labelNode}
</li>

他这里是这样,然后是因为 checkbox 组件里面的一个 span 的样式有 top: 0.2em 属性,就会导致下面这样
image

& > span {
  top: 0;
}

不写死 .ant 前缀的话,像这样吗?感觉没啥区别

Copy link
Member

Choose a reason for hiding this comment

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

ant 这个用户可以自定义的,用户如果改成abc,你给写死了不就不生效了

Copy link
Member Author

Choose a reason for hiding this comment

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

& > span {
  top: 0;
}

那就这样?

top: 0;
}
}
}

&-operation {
Expand Down