Comments (4)
Thank you for clarifying! I will look into this 👍
from keyboardkit.
Happy to hear that you like the library and thank you for letting me know about your problems.
KeyboardKit 8.5.1 adjusted some autocomplete bugs when it comes to empty text. Can you upgrade and see if it solves the problem?
from keyboardkit.
This will be fixed in 8.7
and available in the v8.7
branch later this week.
from keyboardkit.
Hi @danielsaidi,
Thanks for your response. I’ve updated to the latest version (8.5.2) version but unfortunately can still reproduce the bug. I’ll share the stacktrace and my suspicion:
1. KeyboardContext+ProxyBridging.insertAutocompleteSuggestion(_ suggestion: Autocomplete.Suggestion,, tryInsertSpace: Bool = true)
2. UITextDocumentProxy+Autocomplete.insertAutocompleteSuggestion(_ suggestion: Autocomplete.Suggestion, tryInsertSpace: Bool = true)
3. UITextDocumentProxy+Words.replaceCurrentWord(with replacement: String)
That’s where the problem occurs, in the first line of the replaceCurrentWord method we have:
guard let word = currentWord else { return }
But currentWord
resolves as nil when the context is empty. It's a computed variable that's created as following:
var currentWord: String? {
let pre = currentWordPreCursorPart
let post = currentWordPostCursorPart
if pre == nil && post == nil { return nil }
return (pre ?? "") + (post ?? "")
}
And since the context is empty, pre == nil
resolves to true, post == nil
also resolves to true and the currentWord returns nil.
Since it resolves to nil, replaceCurrentWord returns early and, following the normal app flow, just the space is added to the context.
I'm not sure if any changes here could result in major consequences in the app functionality, but I hope this helps the team to spot the issue and improve the library even further! Thanks guys, let me know if I can help in anything.
from keyboardkit.
Related Issues (20)
- Make in-app dictation able to navigate back to the keyboard. HOT 1
- Make host application define URL schemes HOT 1
- Make local autocomplete provider handle unknown suggestions better HOT 1
- Make autocomplete auto-learn unknown suggestions that are applied HOT 1
- Make views and components easier to create by removing the need of injecting state and services. HOT 1
- How to switch QWERTY layout with KeyboardKit Pro HOT 4
- Make SystemKeyboard height more closely match the native height
- The shift key doesn't highlight in dark mode HOT 1
- Make it easier to hide the autocomplete toolbar
- KeyboardKit inserts two period keys for the email keyboard type HOT 2
- The URL keyboard type layout should be adjusted HOT 2
- The number keyboard type should initialize with the number keyboard HOT 2
- Add haptic feedback to emoji keyboard category switching HOT 1
- Autocomplete doesn't handle trailing spaces well HOT 1
- KeyboardContext should only support KeyboardLocale
- Switching language on iPad HOT 17
- Make locale switcher button more customizable
- How can i add custom toolbar with different buttons HOT 3
- Vietnamese Language HOT 7
- Keyboard not show in spotlight search HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keyboardkit.