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

n-message hover will not destroyed (#1036) #1039

Merged
merged 6 commits into from
Sep 4, 2021

Conversation

Volankey
Copy link
Collaborator

@Volankey Volankey commented Sep 1, 2021

close #1036

@vercel
Copy link

vercel bot commented Sep 1, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tusimple/naive-ui/HNeXWH8ZYxdqsKVgzEMN4n8WLKen
✅ Preview: https://naive-ui-git-fork-volankey-message-hover-tusimple.vercel.app

@Volankey Volankey changed the title n-message hover will not destroyed n-message hover will not destroyed (#1036) Sep 1, 2021
@codecov
Copy link

codecov bot commented Sep 1, 2021

Codecov Report

Merging #1039 (b8ca78e) into main (986c0be) will decrease coverage by 0.01%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1039      +/-   ##
==========================================
- Coverage   47.36%   47.35%   -0.02%     
==========================================
  Files         511      511              
  Lines       12628    12633       +5     
  Branches     3557     3559       +2     
==========================================
+ Hits         5981     5982       +1     
- Misses       5633     5636       +3     
- Partials     1014     1015       +1     
Impacted Files Coverage Δ
src/message/src/Message.tsx 70.58% <ø> (ø)
src/message/src/MessageProvider.tsx 63.15% <0.00%> (-1.71%) ⬇️
src/message/src/message-props.ts 100.00% <ø> (ø)
src/message/src/MessageEnvironment.tsx 50.00% <33.33%> (-4.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 986c0be...b8ca78e. Read the comment docs.

Copy link
Collaborator

@07akioni 07akioni left a comment

Choose a reason for hiding this comment

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

  1. This should be a optional feature. Add keepAliveOnHover on n-message-provider and message option.
  2. Duration shouldn't be recaculate after mouse leave.

@Volankey
Copy link
Collaborator Author

Volankey commented Sep 2, 2021

  1. This should be a optional feature. Add keepAliveOnHover on n-message-provider and message option.
  2. Duration shouldn't be recaculate after mouse leave.
  1. This should be a optional feature. Add keepAliveOnHover on n-message-provider and message option.
  2. Duration shouldn't be recaculate after mouse leave.

I don’t agree with the second point. I refer to elementui and antd, i think it should be recaculate.

@07akioni
Copy link
Collaborator

07akioni commented Sep 2, 2021

  1. This should be a optional feature. Add keepAliveOnHover on n-message-provider and message option.
  2. Duration shouldn't be recaculate after mouse leave.
  1. This should be a optional feature. Add keepAliveOnHover on n-message-provider and message option.
  2. Duration shouldn't be recaculate after mouse leave.

I don’t agree with the second point. I refer to elementui and antd, i think it should be recaculate.

Okay, just implement the firsrt

@@ -2,7 +2,7 @@

```html
<n-space>
<n-button @click="info"> 信息 </n-button>
<n-button @click="info"> 信息(Hover不消失)</n-button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<n-button @click="info"> 信息(Hover不消失)</n-button>
<n-button @click="info"> 信息(Hover 不消失)</n-button>

Comment on lines +126 to +127
onMouseenter={this.onMouseenter}
onMouseleave={this.onMouseleave}
Copy link
Collaborator

Choose a reason for hiding this comment

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

这事件会冒泡的,事件处理器要注意这种情况

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

Successfully merging this pull request may close these issues.

Message组件鼠标悬停不销毁(Message component is not destroyed when the mouse hover)
3 participants