be6d1dfb66
* Add 'placement' property * Extract logic for moving text node into instance method ... so that it can be used elsewhere. * Add writable store to indicate whether composition session is active * Work around issue with entering text around MathJax via IME * Make get() called only once while composition session is active
13 lines
440 B
TypeScript
13 lines
440 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
import { writable } from "svelte/store";
|
|
|
|
/**
|
|
* Indicates whether an IME composition session is currently active
|
|
*/
|
|
export const isComposing = writable(false);
|
|
|
|
window.addEventListener("compositionstart", () => isComposing.set(true));
|
|
window.addEventListener("compositionend", () => isComposing.set(false));
|