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
Plugin API addFloatLayer
can be closed by pressing Esc
#8470
Comments
BryceAndJuly
changed the title
Please enter the title of the bug report
通过API Jun 6, 2023
plugin.addFloatLayer
打开的悬浮窗获得焦点后,无法通过按Esc键来关闭悬浮窗。
我看到main.js的最后那里在window对象上挂载了 不然现在要在挂件里用个方法,还得先去安装插件(还好有用户贡献了这个插件,不然还没法用),搞完后弹出的弹窗还有点小问题。 const g_ = new p_();
window.openFileByURL = n => {
if (n && dg(n)) {
const e = (0, E.on)('focus', n) === '1'
return (
he({
app: g_,
id: cl(n),
action: e
? [f.Constants.CB_GET_ALL, f.Constants.CB_GET_FOCUS]
: [f.Constants.CB_GET_FOCUS, f.Constants.CB_GET_CONTEXT],
zoomIn: e
}),
!0
)
}
return !1
}
window._addFloatLayer = n => {
try {
return (
window.siyuan.blockPanels.push(
new _s({
app: g_,
isBacklink: n.isBacklink,
x: n.x,
y: n.y,
targetElement: n.targetElement,
nodeIds: n.nodeIds
}))
,
!0
)
} catch (err) { console.error(err) }
} |
window.openFileByURL 是为了提供移动端和 Pad 使用的,挂载其他方法目前还没有计划。 |
Vanessa219
changed the title
通过API
API Jun 9, 2023
plugin.addFloatLayer
打开的悬浮窗获得焦点后,无法通过按Esc键来关闭悬浮窗。plugin.addFloatLayer
can be closed by pressing esc
88250
changed the title
API
Plugin API Jun 9, 2023
plugin.addFloatLayer
can be closed by pressing esc
addFloatLayer
can be closed by pressing esc
88250
changed the title
Plugin API
Plugin API Jun 9, 2023
addFloatLayer
can be closed by pressing esc
addFloatLayer
can be closed by pressing Esc
有一个问题是这个浮层为什么不可以移动出屏幕,有些时候它挡住了一些内容只能先关闭等看完了被挡内容再打开 |
里面的内容是无法显示在程序以外的,可以使用新窗口功能。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem
通过API
plugin.addFloatLayer
打开的悬浮窗获得焦点后,无法通过按Esc键来关闭悬浮窗。在文档的引用数或文中的引用块弹出的悬浮弹窗,获得焦点后是可以通过按Esc键来关闭悬浮窗的。相比于将鼠标移出弹窗来关闭,通过Esc键来关闭弹窗是个很方便用户的操作,希望能在API打开的悬浮窗中保留此逻辑。
备注:演示中顶栏的插件用的是集市官方的插件示例,在挂件中也能复现此问题。
API.Esc.mp4
Expected result
相比于将鼠标移出弹窗来关闭,通过Esc键来关闭弹窗是个很方便用户的操作,希望能在API打开的悬浮窗中保留此逻辑。
Screenshot or screen recording presentation
No response
Version environment
Log file
none
More information
No response
The text was updated successfully, but these errors were encountered: