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

SelectOption 项添加 tooltip,但 hover 后没展示提示内容 #116

Open
kanglover opened this issue Oct 19, 2022 · 3 comments
Open

Comments

@kanglover
Copy link
Contributor

kanglover commented Oct 19, 2022

代码片段:

<s-select defaultValue="lucy" style="width: 120px;" on-change="handleChange">
      <s-select-option value="jack">
            <s-tooltip title="prompt text">
                  <span>Jack</span>
            </s-tooltip>
      </s-select-option>
      <s-select-option value="lucy">
            <s-tooltip title="prompt text">
                  <span>Lucy</span>
            </s-tooltip>
      </s-select-option>
  </s-select>

在线示例:https://codesandbox.io/s/restless-frost-hcdt9v?file=/src/index.js

@kanglover
Copy link
Contributor Author

不知道为啥 trigger 的 on-mouseenter 没有被触发,貌似也没有阻止冒泡行为

@kanglover
Copy link
Contributor Author

kanglover commented Oct 20, 2022

最终结论:其实是因为实际渲染是节点是被隐藏掉的,下拉的内容其实是一份拷贝,所以挂载的方法什么的都会失效。
代码:https://github.com/ecomfe/santd/blob/master/src/select/DropdownMenu.js#L24
c1c601af0a90f9e5fa3618b4b1f6c126
d5dac671577e888d2fbc582528196ac7

san 不支持 jsx,按现在的设计思路,很难改造啊。感觉得改整个组件,换成 slot 方式来插入原组件示例

@zhangshuchen
Copy link

另外on-change 事件的option参数没有生效

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

No branches or pull requests

2 participants