jaredreich / jaredreich/pell

Is there a recommended way of restricting input length?

Open
#169 5 comments 0 reactions 0 assignees View on GitHub
feature plugin
Dominant language
JavaScript
Stars
12k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

First off, thanks for creating such a simple, useful plugin!

I find myself needing to limit the length of text a user may enter into the pell editor. I'm tempted to tack on an event listener and call `preventDefault` on the event object if the length of the pell editor's value is longer than N. Though, that seems like a kludge and like I'm working against the editor.

So, is there a recommended way of limiting the amount of text a user may enter into the pell editor? I'm looking at the source now and don't see any obvious solutions. Perhaps the event object could be passed to `settings.onChange` from within [`content.oninput`](https://github.com/jaredreich/pell/blob/master/src/pell.js#L123-L126)?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading src/pell.js around content.oninput at lines 123-126 and review how settings.onChange currently receives changes. Determine the intended behavior for limiting input length, including how pasted or edited content is handled, then verify the behavior with the existing test setup if applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.