Skip to content

disableInInput disables tag "a" along with "input" and "textarea" #7

@ophilan

Description

@ophilan

Hello,

Firstly thank you for your good work, the plugin works fine.

I did however found one bug: when you set disableInInput option to true, tag "a" is disabled as well, "a" being obviously included in "textarea".

I modified the triggeredInDisableTags function to enclose the tags between asterisks (*) and it seems to solve the problem.

Modified function (replace [asterisk] by an asterisk, I had to do this noticing that the "preview" was deleting most of them ?):

function triggeredInDisableTags(event, disableInInput) {
if (!disableInInput){
return false;
}
var disableTags = '[asterisk]textarea[asterisk]input[asterisk]';
var element = event.target || event.srcElement;
if (element.nodeType === 3) { element = element.parentNode; }
return (disableTags.toLowerCase().indexOf('[asterisk]'+element.tagName.toLowerCase()+'[asterisk]') >= 0) ? true : false;
}

I don't know if this is a clean or dirty fix ;) but I felt I had to share it.

Thanks again.

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