Replying to posts: Move reply cursor to after username
-
Currently, when you reply to a post in a thread by clicking the Reply link on that post, it inserts the username into the editor and puts the cursor before the username. In my opinion, and this may just be because I'm using to the way mentions work on Twitter, I think the cursor should be automatically placed with a space after the username, like this:
as opposed to this, the way it currently works (although it does add a space at the end of the username):
With the way it currently works, I press the End key on my keyboard and I'm fine, but I think it would be nice if the cursor just started there anyway. Might just be me, though.
-
You can select and delete it
Or you can try something like
$(window).on('action:composer.enhanced', function (ev, data) { if (data.action === 'posts.reply' && data.toPid) { data.postContainer.find('.write').val(''); } });
Keep in mind this will always empty the textarea so it will break quoting you need to only clear it if the text area contains
@username
so might have to add a regex check into the conditional. -
@baris said in Replying to posts: Move reply cursor to after username:
You can select and delete it
Or you can try something like
$(window).on('action:composer.enhanced', function (ev, data) { if (data.action === 'posts.reply' && data.toPid) { data.postContainer.find('.write').val(''); } });
Keep in mind this will always empty the textarea so it will break quoting you need to only clear it if the text area contains
@username
so might have to add a regex check into the conditional.Quoting also contains
@username
. Might need to check for the topic title.