Comments (5)
Not sure why the circumflex would be deleted. I can't reproduce that on my machine. However, I now made sure a⋅⋅b gets parsed as a^b in the latest commit.
from kalker.
Thanks!
I think its because I'm on a german quertz keyboard and entering a circumflex would start to create a compose key input. Like the sequence ^ a
results in â
. If i actually want to type a circumflex, I would have to type ^ ^
. The first circumflex to enter composing mode, and the second one to confirm the compose as "yes i would like a circumflex". The same thing is with keys like ` and ´
In the oninput event this behaviour seems to be handled with specifying the composed
and isComposed
properties in the event.
In total there are 4 oninput events that are triggered:
First: ^
{"isComposing":true,"composed":true,"inputType":"insertCompositionText","data":"^"}
Second: ^
{"isComposing":true,"composed":true,"inputType":"insertCompositionText","data":""}
{"isComposing":false,"composed":true,"inputType":"insertCompositionText","data":""}
{"isComposing":false,"composed":true,"inputType":"insertText","data":"^"}
Note that the circumflex immediately disappears after typing the first one - without any further interaction... So my guess would be that the whole composition cycle gets somehow cancelled and therefore deletes the "fake" circumflex that indicates that i am in the composing mode...
Here is some more info on that bizz.
from kalker.
I managed to reproduce these shenanigans:
<html>
<head>
<script>
function inp(e) {
let b = document.getElementById("blub");
e.target.selectionStart = e.target.selectionStart;
e.target.selectionEnd = e.target.selectionStart;
}
</script>
</head>
<textarea id="blub" oninput="inp(event)"></textarea>
</html>
So i guess the problem is that when I enter the composing mode by entering the first circumflex, the selection of the textfield is immediately updated, which is interpreted by the browser as "the cursor moved so we need to cancel the composing"
If i wrap the changing of the selection in an if, then it works.
<html>
<head>
<script>
function inp(e) {
let b = document.getElementById("blub");
if (e.inputType !== "insertCompositionText") {
e.target.selectionStart = e.target.selectionStart;
e.target.selectionEnd = e.target.selectionStart;
}
}
</script>
</head>
<textarea id="blub" oninput="inp(event)"></textarea>
</html>
Maybe inserting a similar if here solves the issue....
kalker/web/src/KalkCalculator.svelte
Lines 221 to 235 in e50d398
But I am not at all aware of any side effects this may have, and I know nearly nothing about this whole key composing stuff myself, so take all of this with a grain of salt, should you or someone else decide to look into this rabbithole.
from kalker.
This would be a very quick fix for it, that seems to work reasonably well: MonaMayrhofer@77bd037. Normally the circumflex would be somehow highlighted as being "fake", (normally underlined), but that would not be as straight forward to implement.
Well that's it for me for now, I don't know how many users are actually affected by this (i personally thought this was standard behavior but as you cannot reproduce it, it does not seem to be as standard).
from kalker.
@MonaMayrhofer That looks like a reasonable fix and doesn't seem to cause any issues, neat. Feel free to make a pull request!
from kalker.
Related Issues (20)
- LaTeX syntax support HOT 1
- `gcd` shows wrong result when input number is too large HOT 8
- Feature Request: Add support for bitwise operators HOT 1
- How to prevent stack overflow on tokio thread HOT 2
- kalker doesn't follow XDG specification HOT 1
- kalker crashes or bugs out for certain `base` values HOT 1
- thread 'main' has overflowed its stack
- Big Integers are incorrect resulting in errors doing modular arithmetic HOT 2
- 1e3 != 1000. HOT 1
- Issue to build version 2.1.0 on Arch Linux (AUR package) HOT 10
- Broken link in kalk README HOT 1
- Inconsistent sqrt syntax HOT 3
- Unintuitive use of ≈ HOT 7
- Variable assignment doesn't work HOT 1
- Weird results when executing multiple commands at once HOT 1
- Weird results when using ≈ in equations HOT 1
- solving `sin x = 0`: undefined variable
- Kalker wont build on windows HOT 3
- Very numbers become complex numbers? HOT 1
- Disable starting each response with = HOT 1
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 kalker.