-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Improve tooltip #13326
Merged
Merged
Improve tooltip #13326
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messageElement.innerHTML = message; 会更新元素的内容,元素此时的 left 属性会对元素的宽度产生影响,导致更新后的元素(比如元素内的文本意外换行了)与直接新建的元素(元素内的文本不会换行)宽度不一致。messageElement.clientWidth 会获取到不符合预期的宽度,进而导致 left 计算错误。
这个主题是?我想重现一下看看
default.webm |
Savor 主题(我用的是 Sugar 配色)。 其实把这个按钮的位置改到最右边就能复现了。 |
-1 的原因是?
|
左移 1px 避免发生换行 |
左右Dock栏,从上往下移动的时候,取消闪烁后会有点影响使用。感觉还需要优化一下。 v3.1.14 演示视频v3.1.14.mp4v3.1.15-dev1 演示视频v3.1.15-dev1.mp4 |
所以我觉得 50ms 就挺合适的,不过这个逻辑已经去掉了 |
@Vanessa219 话说 50ms 有什么问题吗?现在这个情况还是应该优化的: video.webm50ms 的效果: video.webm |
delay 删除了,否则鼠标在移动的过程中,tip 无法消失。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
减少不必要的元素更新
改进悬浮提示元素位置计算 fix 改进悬浮提示宽度 #12680
messageElement.innerHTML = message;
会更新元素的内容,元素此时的 top 和 left 属性会对元素的高度和宽度产生影响,导致更新后的元素(比如元素内的文本意外换行了)与直接新建的元素(元素内的文本不会换行)宽度不一致。messageElement.clientWidth
会获取到不符合预期的宽度,进而导致 top 和 left 计算错误。特殊情况下悬浮提示会换行一个字 fix 改进悬浮提示宽度 #12680
隐藏悬浮提示增加少许延迟,避免在相邻的元素间移动时悬浮提示频繁闪烁
元素没有完全紧挨着就会出现这样的闪烁:
video.webm