YaleDHLab / ensemble-at-yale

Crowdsourcing the transcription of Yale playbills - http://bit.ly/ensemble-at-yale
http://ensemble.yale.edu
MIT License
6 stars 4 forks source link

Allow Command/Control-A to select all in text fields #160

Closed pleonard212 closed 5 years ago

pleonard212 commented 5 years ago

I think this is being hijacked by some JS component, but select-all is really useful when you mistakenly type a character in an actor field or vice-versa, for cutting and pasting quickly.

duhaime commented 5 years ago

This behavior is evidently driven by the input component used in the transcribe workflow.

This input is a "controlled" component, which means it's really controlling the state of the input pretty carefully. Were it a stateless component that just read the input value when it's time to submit, the default keyboard combinations would function, but making this input stateless and uncontrolled would mean changing quite a bit of the internals.

The easiest way to solve this is just to store the keys pressed at any time, and listen for keyboard combinations of interest (CTRL+a / CONTROL+a)...