fix: [Transfer] Fixed Transfer in Popover causing Popover to close wh… #1247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…en dragged
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
Fixes #1149 #1226
Changelog
🇨🇳 Chinese
🇺🇸 English
Checklist
Other
Additional information
修复 Popover 中的 Transfer 在拖拽时导致 Popover 意外关闭问题:

Transfer原来将 SortableItem 和 SortableList定义在 render 相关的函数中,导致在点击拖拽 handler icon 时候,弹层挂载在 window 上的 mouseDown 事件中(semi-ui/tooltip/index)判断该点击的位置在非trigger 且非弹出层内部,因此关闭弹出层。弹出层关闭后,鼠标松开,正在被拖拽的 item (helper)走放下的逻辑,由于弹出层已经消失,此时会导致 helper找不到父元素,报TypeError错误
修改方法:将 SortableItem 和 SortableList 放在 Transfer 外部进行定义, 参考Cannot read property 'removeChild' of null clauderic/react-sortable-hoc#549
修复弹出层中的 Transfer/ TagInput 在拖拽时被拖拽项消失问题
参考https://github.com/clauderic/react-sortable-hoc/issues/87, 通过 SortableList 的 helperClass 参数设置正在被拖拽元素的 helper(克隆的被拖拽 item)的样式,使得其 z-index高于 semi 中的所有弹出层的 z-index