codemirror-interact
codemirror-interact copied to clipboard
Package seems to only support updating by an integer value (can't divide e.movementX).
onDrag: (text, setText, e) => {
const newVal = Number(text) + (e.movementX / 20);
if (isNaN(newVal)) return;
setText(newVal.toString());
},
When trying to update a numeric value by a decimal value, it still adds the ending decimal point to the final value.
Absolutely love this feature, but it'd be immeasurably more helpful if I could update more granularly! Especially with a viewport normalized to [-1, 1] on both axes (I'm using GLSL to write fragment shaders).