[invokers] setRangeText for textarea and inputs
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 4.5k
- Forks
- 226
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 4
Description
Similar to stepUp and stepDown it would be helpful to be able to invoke setRangeText to insert a string into a textarea or an input. This would require being able to pass an argument, perhaps through the value attribute.
Example:
<button commandfor=textarea command=set-range-text value="«">«</button>
<button commandfor=textarea command=set-range-text value="»">»</button>
<label for=textarea>Enter your text here:</label>
<textarea id=textarea>
It was a dark and stormy night...
</textarea>
Original text
Similar to [`stepUp` and `stepDown`](https://github.com/openui/open-ui/issues/968) it would be helpful to be able to invoke setRangeText to insert a string into a textarea or an input. This would require being able to pass an argument, perhaps through a separate attribute such as `invokeargument`.Example:
<button invoketarget=textarea invokeaction=setRangeText invokeargument="«">«</button>
<button invoketarget=textarea invokeaction=setRangeText invokeargument="»">»</button>
<label for=textarea>Enter your text here:</label>
<textarea id=textarea>
It was a dark and stormy night...
</textarea>
Motivation
Some UTF characters are incredibly hard to enter. If and how the user can input them depend on the users operating system, user agent and input device.
In example: As a Norwegian publisher we strive to use the correct punctuation marks. Some of the punctuation marks such as the guillemet («») quotation marks are not even available on the Norwegian keyboard. Entering the correct characters requires using keyboard combinations that are difficult to remember. Being able to provide shorthand buttons to input these characters without JS would be very helpful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading this issue and the related stepUp/stepDown discussion in open-ui issue 968, then compare the proposed command and value attributes with the setRangeText behavior for textarea and input elements. Done would require a resolved invocation design that passes the requested string and a documented outcome for inserting it without JavaScript.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100