4

My problem :

When / is clicked I want to move the cursor pointer to numerator \frac{ cursor here }{} When pressed from keyboard it is ok but when through button event it's not working fine. I want a solution if have any? Here is the mathquill library I'm using:

MathQuill Library

I'm trying to edit library but not successfully edited. I want your help to do this.

I want below working:

I want this

1 Answers1

3

I've got the solution of this problem that I posted months ago. I've updated the mathquill.min.js library. Just I'd done this using some regex, here is the code of this action:

(at = Et.over = At["/"] = Qt(ot, function (e, n) {
        e.createLeftOf = function (e) {
            if (!this.replacedFragment) {
                for (var i = e[Tt]; i && !(i instanceof Q || i instanceof (Et.text || t) || i instanceof rt || "\\ " === i.ctrlSeq || /^[,;:]$/.test(i.ctrlSeq)); ) i = i[Tt];
                i instanceof rt && i[Ct] instanceof st && ((i = i[Ct]), i[Ct] instanceof st && i[Ct].ctrlSeq != i.ctrlSeq && (i = i[Ct])), i !== e[Tt] && (this.replaces(Lt(i[Ct] || e.parent.ends[Tt], e[Tt])), (e[Tt] = i));
            }
            n.createLeftOf.call(this, e);
        };
    })),