Skip to content

Add plugin event bus mobile-keyboard-show and mobile-keyboard-hide #9773

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

Closed
Wetoria opened this issue Nov 28, 2023 · 8 comments
Closed

Add plugin event bus mobile-keyboard-show and mobile-keyboard-hide #9773

Wetoria opened this issue Nov 28, 2023 · 8 comments
Assignees
Milestone

Comments

@Wetoria
Copy link

Wetoria commented Nov 28, 2023

In what scenarios do you need this feature?

近期开发了移动端底部导航栏插件。为了优化交互效果,需要是否知道键盘是否会弹出。

Describe the optimal solution

目前思源插件已经有了 EventBus 机制,并且官方的 KeyboardToolBar 已经实现了键盘的监听效果,只需要在相关逻辑里提供对应的事件类型就可以了。不知道这个事件类型否能够提供?

Describe the candidate solution

目前我是用监听 keyboardToolBar 的显隐状态实现的这个功能。
image

Other information

由于近段时间刚开始加入思源笔记的开发,所以很多内容并不了解,如果有什么内容属于我自己遗漏了,还请D大和V姐见谅。

@Wetoria Wetoria changed the title Provide keyboard show status changed event. Keyboard show status changed event. Nov 29, 2023
@88250 88250 changed the title Keyboard show status changed event. Add soft keyboard show status changed event on mobile Nov 29, 2023
@88250 88250 added this to the 2.11.1 milestone Nov 29, 2023
@Vanessa219
Copy link
Member

主要是实现一个什么功能?

@Vanessa219 Vanessa219 removed this from the 2.11.1 milestone Nov 30, 2023
@88250 88250 added this to the 2.11.1 milestone Nov 30, 2023
@88250
Copy link
Member

88250 commented Nov 30, 2023

楼主还在吗?

@Wetoria
Copy link
Author

Wetoria commented Nov 30, 2023

楼主还在吗?

在的 D 大。我 GitHub 上的不勤快。我去改一下代码,提供一下说明。

@88250
Copy link
Member

88250 commented Nov 30, 2023

嗯,需要探讨一下使用场景。

@Wetoria
Copy link
Author

Wetoria commented Nov 30, 2023

主要是实现一个什么功能?

V姐,目前的话,我是个人用插件实现了移动端底部导航栏的功能。但是在键盘弹出的时候,这个导航栏有点碍事。

所以我就出现了“需要知道键盘弹出状态”这样一个能力。我看到目前移动端是会根据键盘弹出状态显示 工具栏 的,所以用监听了 工具栏 的显示状态实现了一版。

由于系统级已经实现了键盘的监听,所以看看是不是可以考虑提供一个事件类型。

image

image

@88250
Copy link
Member

88250 commented Nov 30, 2023

直接把插件 HTML 插入到工具栏的 DOM 里面可行否?

@Wetoria
Copy link
Author

Wetoria commented Nov 30, 2023

直接把插件 HTML 插入到工具栏的 DOM 里面可行否?

直接插入似乎是不行的,因为导航的出现逻辑跟工具栏正好是相反的。

@88250
Copy link
Member

88250 commented Nov 30, 2023

哦哦,懂了。我们考虑下,谢谢。

@Vanessa219 Vanessa219 changed the title Add soft keyboard show status changed event on mobile Add plugin event bus mobile-keyboard-show and mobile-keyboard-hide Dec 1, 2023
Vanessa219 added a commit that referenced this issue Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants