Skip to content

ignoreReturns: true not respected #64

Description

@smileBeda

The default implementation of below does not respect the ignoreReturns: true:

$( window ).on('load', function() {
    Countable.on( 
        document.getElementById('my_area'), 
        counter => console.log(counter),
        {
            ignoreReturns: true
        }
    )  
});

Doing so, the all property still counts returns (enter/newline)

Thus, we always get a wrong character count when doing this:

$( window ).on('load', function() {
    Countable.on( 
        document.getElementById('my_area'), 
        counter => document.getElementById('my_result').innerHTML = counter.all.toString(),
        {
            ignoreReturns: true
        }
    )  
});

The doc clearly states that we shall use that option to Ignore returns when calculating the all property.

Suggestions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions