psergus / ngWYSIWYG

true angular WYSIWYG
MIT License
63 stars 42 forks source link

Any way to select text content on focus? #19

Open richardchou opened 9 years ago

richardchou commented 9 years ago

Hi,

I was wondering how I would set the behavior of the editor to select all of the text content in the editor when you focus by clicking on the text box? This way if there is a default message selected, the user can just type over it to create a new message.

For normal text boxes, it is possible to do this in angular by writing directive that gets the window, then selects the element on click.

Thanks!

psergus commented 9 years ago

hmm, sorry a bit confused by what you mean. Do you have examples or maybe can you provide more details pls?

On Fri, Nov 20, 2015 at 2:55 PM, Richard Chou notifications@github.com wrote:

Hi,

I was wondering how I would set the behavior of the editor to select all of the text content in the editor when you focus by clicking on the text box? This way if there is a default message selected, the user can just type over it to create a new message.

For normal text boxes, it is possible to do this in angular by writing directive that gets the window, then selects the element on click.

Thanks!

— Reply to this email directly or view it on GitHub https://github.com/psergus/ngWYSIWYG/issues/19.

Best regards, Sergey Petrenko

richardchou commented 9 years ago

This stackoverflow question is pretty much what I want to do: http://stackoverflow.com/questions/14995884/select-text-on-input-focus

However instead of generic html text-areas, I would like to apply it to the iframe that the editor is in somehow.