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

Tab on screen keyboard #98

Closed
writing-shed opened this issue Jan 17, 2021 · 5 comments
Closed

Tab on screen keyboard #98

writing-shed opened this issue Jan 17, 2021 · 5 comments

Comments

@writing-shed
Copy link

Given that there is no tab key on the screen kbd have you any idea how to simulate one given that List Processing depends on it. I can set up an item using UIMenuController, but can't work out how to invoke handleKeyCommand.

@rajdeep
Copy link
Owner

rajdeep commented Jan 20, 2021

@writing-shed, you have raised a good point. It looks like API can be improved a little, and I'll find time to expose better construct to be able to do that. Having said that, given the current API design, you can use ListTextProcessor.handleKeyWithModifiers() with appropriate arguments to simulate the same behaviour. For example, executing the following code in Encode button yields the result shown in gif below:

ListTextProcessor().handleKeyWithModifiers(editor: editor, key: .tab, modifierFlags: [], range: editor.selectedRange)

indent-button

For more such examples, checkout EditorListsSnapshotTests.swift.

@writing-shed
Copy link
Author

Thanks for this, I'll give it a whirl.

@writing-shed
Copy link
Author

I tried doing this using a menu added to the shared UIMenuController, only to discover that there is bug in SwiftUI! It doesn't display the menu, so I've had to submit a bug report.

@rajdeep
Copy link
Owner

rajdeep commented Jan 24, 2021

@writing-shed, shall we close this issue? It might just be helpful to others to mention the bug you've logged in SwiftUI.

@writing-shed
Copy link
Author

writing-shed commented Jan 24, 2021

The feedback reference is https://feedbackassistant.apple.com/feedback/8977163

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

2 participants