Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text selection usability degradation #278

Closed
hyzhak opened this issue Dec 18, 2017 · 9 comments
Closed

Text selection usability degradation #278

hyzhak opened this issue Dec 18, 2017 · 9 comments

Comments

@hyzhak
Copy link
Contributor

hyzhak commented Dec 18, 2017

Bug reports

Version

2.0.2

Steps to reproduce

Expected Behavior

  • text in typeahead should be selectable from any part of the component

Actual Behavior

  • you won't able to select text this way, only by starting dragging from typed text.

Additional

The previous version (1.3.0) of this component is used here http://web.archive.org/web/*/github. So you could select text by dragging cursor cross the component. but in new version here https://web-beta.archive.org/web/*/github (where is used the last version of the component) it won't able to achieve.

Possible solution: increase side of inner input which was fit to the side of typeahead component in 1.3.0 version, but now just fit a typed text.

@ericgio
Copy link
Owner

ericgio commented Dec 18, 2017

Thanks for the report. This is expected, though I admit it's not ideal. For context, I rewrote the input in v2.0 to render the same way in both the single- and multi-select cases. This was done to simplify the code paths and hopefully reduce bugs in the process. The tradeoff is that it introduces some subtle behaviors like what you're describing. I haven't spent much time trying to solve this particular issue because it feels relatively minor and doesn't prevent any functionality.

Are you reporting the issue mainly just to bring it to my attention or did you feel like it was a significant behavioral problem?

@hyzhak
Copy link
Contributor Author

hyzhak commented Dec 18, 2017

Thanks for your response! Yes, it is considered as a major issue.

@ericgio
Copy link
Owner

ericgio commented Jan 10, 2018

This should be mostly fixed as of v2.0.3. For the single-select case, the input is now full-width, allowing users to double-click or drag to select. Please note that because the form-control classname is applied to the containing div and not the input itself, there are still a few pixels of padding around the input. If a user clicks there and tries to drag, it won't quite work the way a true input would.

@ericgio ericgio closed this as completed Jan 10, 2018
@alasdairhurst
Copy link
Contributor

alasdairhurst commented Feb 9, 2018

@ericgio I still find this is still an issue in 2.2.0.
styling the component with the following CSS allows text to be selectable when a hint is displayed. Since no mouse input is needed for the hint text we can just disable it. The selection text colour/style itself has always been a bit dogy with the hint though.

	.rbt-input-wrapper > div > div {
		pointer-events: none;
	}

image

@ericgio
Copy link
Owner

ericgio commented Feb 11, 2018

@alasdairhurst: I'm not sure I understand exactly what you're saying here. Can you please clarify?

@alasdairhurst
Copy link
Contributor

The current functionality I see is when then hint text is visible (i.e. when the input has focus + there is a hint available), text highlighting is pretty dodgy and you can't select the full text. This is because the click events are being "stolen" by the hint text. By disabling pointer events on the hint text, the user can now highlight the real text properly.

See the example above: you cannot select $.params.body if there is a hint displayed.

The only two issues I see is that selection is still a little bit difficult on the far left, making it hard when there is only a single character and highlighting the text in a left to right motion, and the styling as seen in the screenshot in my last comment (you would expect white text but it'some odd mix of grey due to a clash with the hint text by the look of things)

@alasdairhurst
Copy link
Contributor

See here:
https://jsfiddle.net/alasdairhurst/mgwLfodx/3/

  • start typing $.params.body
  • try to select the text
  • see that it can be selected
  • delete the css that sets pointer-events: none
  • try again and see that the text cannot be selected

@ericgio
Copy link
Owner

ericgio commented Feb 12, 2018

I see what you're saying. Yeah, that's weird.

@ericgio
Copy link
Owner

ericgio commented Feb 12, 2018

@alasdairhurst: That issue should be fixed as of v2.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants