Skip to content

Backspace key handling bug on swanalekha-ml.js #4

@pshanoop

Description

@pshanoop

After writing അവള് , If I clear all letters using backspace key then if I press 'a' it gives letter 'ള' instead of 'അ'. I think error is on pattern = pattern.replace(/aAeEiIoOuU0-9/g, ''); this isn't working.

I tried another code in my jQuery version of swanalekha

    pos = element.selectionStart; //line position changed
            if(kCode === 8){ //backspace
                // this.pattern = this.pattern.replace(/[aAeEiIoOuU0-9]/g,'');
                this.pattern = this.pattern.slice(0, -1);               
                this.patternStart = pos;
                this.tabCount =1;       
                return;
            }

I haven't tested this very well. As per my understading of your algorithm I think it will work. Please verfy so that I can make another pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions