react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Cursor position at the begining

Open stesvis opened this issue 3 years ago • 30 comments
trafficstars

In version 5.3.2 I am still experiencing the cursor always being positioned at the beginning of the text.

Repro

No need for the repro, just try it in the demo at https://react-select.com/home and set the focus on the first select field. I understand that there is a <span /> and a <div class="react-select__single-value" /> field overlapping, but is there really no solution for this?

UX is a little bit funny when you expect to be able to edit the text but in reality it's empty text... I found old related issues but they are quite old so I thought I'd give it a try again with a new one. Thx

stesvis avatar May 24 '22 21:05 stesvis

I can not see the issue

https://user-images.githubusercontent.com/44392283/171256816-3b507619-3711-4bf0-aff1-9b40cc84f142.mov

fercc1097 avatar May 31 '22 18:05 fercc1097

I can not see the issue

Screen.Recording.2022-05-31.at.13.15.51.mov

Thanks for your reply! Sorry maybe I forgot to mention that I am referring to searchable selects, where you can type. If there is a value selected and you want to edit it, you blick in the box and the cursor is always at position 0:

image

stesvis avatar May 31 '22 19:05 stesvis

Bump

benquinteros avatar Jun 17 '22 00:06 benquinteros

I investigated and it's because the input itself doesn't have the value. We must ask the maintainers what are the plans on implementing this

image

idiglove avatar Jun 29 '22 11:06 idiglove

Any updates on this?

choxnox avatar Sep 19 '22 06:09 choxnox

Bumping this for visibility.

tocttou avatar Oct 11 '22 08:10 tocttou

Bump

Cypherball avatar Nov 14 '22 13:11 Cypherball

any solution on this?

rubimbura avatar Dec 13 '22 15:12 rubimbura

This is a major problem from a UX perspective

DawnSpark7 avatar Dec 15 '22 06:12 DawnSpark7

:cricket:

e-monson avatar Jan 30 '23 17:01 e-monson

This is absolutely still an issue as of v5.4.0. When clicking on the input while it is populated with a value, the cursor is locked at position 0. So if a user wants to edit or add text to the existing value, they have to rewrite the entire value. It is indeed a problem from a UX perspective

BideoWego avatar Feb 07 '23 21:02 BideoWego

Bump

codebravotech avatar Mar 10 '23 22:03 codebravotech

🤰 Bumb

jim-alexander avatar Mar 25 '23 19:03 jim-alexander

same

inomn avatar Apr 03 '23 16:04 inomn

Bump! It seems like a reasonable use for this with isSearchable will lead to another bump in here 🗡️

elsheraey avatar Apr 08 '23 09:04 elsheraey

bump :/

siduck avatar May 14 '23 07:05 siduck

BUMP

abdullah-ch-empg avatar Jun 12 '23 09:06 abdullah-ch-empg

Bump

ganiirsyadi avatar Jun 12 '23 10:06 ganiirsyadi

Hello Bumpers, check this out. Thanks to whoever made it :)

elsheraey avatar Jun 12 '23 10:06 elsheraey

Hello Bumpers, check this out. Thanks to whoever made it :)

Does it work for you? When I select something and then press the button I get selectRef.current is undefined

mkaraula avatar Jun 12 '23 10:06 mkaraula

@mkaraula

The cursor works according to my needs.

For the focus button, it's just lacking the ref in the Select component.

<Select
  ref={selectRef} // <<< ADD THIS LINE
  options={options}
  value={value}
  inputValue={inputValue}
  onInputChange={onInputChange}
  onChange={onChange}
  components={{
    Input
  }}
/>

elsheraey avatar Jun 12 '23 10:06 elsheraey

In this example, after the value is selected, the options are filtered and showing only selected option. image It is indeed a problem from a UX perspective. Maintainer must plan to fix this issue.

vigneshwaran-ravi avatar Sep 27 '23 06:09 vigneshwaran-ravi

bump

alymkarimg avatar Oct 12 '23 00:10 alymkarimg

bump

pavan-kumarv avatar Nov 24 '23 03:11 pavan-kumarv

image Maybe someone find it usefull. I use this solution for controlled input. Haven't tested yet really deep but it seems work okay for my case.

Appolinars avatar Feb 29 '24 12:02 Appolinars

@mkaraula

The cursor works according to my needs.

For the focus button, it's just lacking the ref in the Select component.

<Select
  ref={selectRef} // <<< ADD THIS LINE
  options={options}
  value={value}
  inputValue={inputValue}
  onInputChange={onInputChange}
  onChange={onChange}
  components={{
    Input
  }}
/>

Setting the inputValue prop is what did it for me. Thanks @mkaraula !

russtuck91 avatar Apr 09 '24 18:04 russtuck91