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

关闭实时预览时添加的TextWatcher不生效 #72

Open
OneDongua opened this issue Aug 2, 2024 · 0 comments
Open

关闭实时预览时添加的TextWatcher不生效 #72

OneDongua opened this issue Aug 2, 2024 · 0 comments

Comments

@OneDongua
Copy link

使用MarkdownEditText时,我添加了TextWatcher用于实现撤销与重做功能,同时我提供了一个开关,用于关闭实时预览功能,逻辑是直接不执行MarkdownProcessor的初始化操作。

但是当MarkdownProcessor的初始化操作没有被执行时,我的TextWatcher没有生效。翻阅源码后,发现额外添加的TextWatcher依赖于mEditTextWatcherMarkdownEditText.EditTextWatcher)实现,而它仅在setFactoryAndConfig方法中被添加到超类中,又因为setFactoryAndConfig的唯一用法是MarkdownProcessor.live(editText),所以导致了不生效。

并且,提供的clear()方法也会卸载mEditTextWatcher,所以没有方法能在取消实时预览的同时使用其它TextWatcher的方法。

这应该是一个Bug,否则clear()方法也会导致这个问题出现。

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

No branches or pull requests

1 participant