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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶 Key event should be released if text view lost focus or after relinquished first responder #57

Closed
neesonqk opened this issue Sep 8, 2022 · 2 comments 路 Fixed by #211
Labels
bug Something isn't working

Comments

@neesonqk
Copy link

neesonqk commented Sep 8, 2022

https://github.com/CodeEditApp/CodeEditTextView/blob/9b300d8a37589f4e16719f98d1bf8763940ef0b2/Sources/CodeEditTextView/STTextViewController.swift#L182

Here, this line will be always executed whenever 'Tab' key is pressed, e.g. if the focus is on a other tab or command palette, all open tabs will insert a tab space.

textView?.insertText(String(repeating: " ", count: tabWidth))
@thecoolwinter
Copy link
Collaborator

Good catch. This should be triggered in the delegate method textView(_ textView: STTextView, didChangeTextIn affectedCharRange: NSTextRange, replacementString: String).

@lukepistrol lukepistrol added the bug Something isn't working label Nov 22, 2022
@lukepistrol lukepistrol changed the title Key event should be released if text view lost focus or after relinquished first responder 馃悶 Key event should be released if text view lost focus or after relinquished first responder Nov 22, 2022
@austincondiff
Copy link
Collaborator

Can we confirm that this issue still exists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 馃弫 Complete
Development

Successfully merging a pull request may close this issue.

4 participants