Here is a basic input field with some text inside:
document.querySelector('.input').value = 'Double click on words without extra space'
.input {
width: 400px
}
<input type="text" class="input" placeholder="">
When double-clicking any word in the input, it will be selected along with an extra space after it, except for the last word.
Is there a way to have double-clicking select only the whole word without including that additional space?