Skip to content

Commit

Permalink
fix(float-button): error when using with popover, closes #5933
Browse files Browse the repository at this point in the history
  • Loading branch information
jizai1125 committed May 17, 2024
1 parent a6d4b11 commit 36e3e32
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### Fixes

- Fix `n-float-button` error when using with `popover` component, closes [#5933](https://github.com/tusen-ai/naive-ui/issues/5933).

## 2.38.2

`2024-05-03`
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### Fixes

- 修复 `n-float-button``popover` 一起使用会报错, 关闭 [#5933](https://github.com/tusen-ai/naive-ui/issues/5933)

## 2.38.2

`2024-05-03`
Expand Down
11 changes: 3 additions & 8 deletions src/float-button/src/FloatButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ import {
type CSSProperties,
inject,
ref,
toRef,
withDirectives,
type DirectiveArguments
toRef
} from 'vue'
import { useMergedState } from 'vooks'
import { mousemoveoutside } from 'vdirs'
import { floatButtonGroupInjectionKey } from '../../float-button-group/src/FloatButtonGroup'
import {
formatLength,
Expand Down Expand Up @@ -209,9 +206,8 @@ export default defineComponent({
inlineStyle,
onRender
} = this
const dirs: DirectiveArguments = [[mousemoveoutside, this.handleMouseleave]]
onRender?.()
return withDirectives(
return (
<div
class={[
`${mergedClsPrefix}-float-button`,
Expand Down Expand Up @@ -258,8 +254,7 @@ export default defineComponent({
{resolveSlot($slots.menu, () => [])}
</div>
) : null}
</div>,
dirs
</div>
)
}
})

0 comments on commit 36e3e32

Please sign in to comment.