Lack of auto-focus when hitting Reply on multi-input systems?

javascript

(Lee Griffin) #1

Hi, I use a system set up where I have a touchscreen monitor as well as an attached mouse. I also have a laptop where it only has the mouse for input.

If I hit reply on my laptop, the focus is automatically set to the message input box so that I can begin typing straight away. However with my system with the touchscreen monitor attached, this focus isn’t given. A recent change must have happened since this wasn’t an issue until perhaps a week or two ago, and to me it feels like a fairly commonplace misjudgement of possibly assuming that if a touch enabled system is detected, that it should act like a touch-only device.

If this is the case I’d hope something as simple as a flag on mouse movement would allow you to define a session as being one of multi-input potential and to either act like a mouse-only device, or to keep a track of what the last interaction was and deliver the appropriate user-journey to providing for the on-screen interactions?


User Experience on Discourse with optional touch-input
(Joshua Rosenfeld) #2

This is an issue I have recently discovered as well.

I also have a laptop with an external touch screen monitor, and Discourse definitely acts differently when I am connected to it.


That is an issue similarly caused by the attached touchscreen. Now that I think about it, I have also noticed that the cursor focus does not always happen when it is connected. I would agree that having an attached touch-enabled device should not cause Discourse to function as if you were on a touch only device.


(Jeff Atwood) #3

There is literally no known way to detect this condition. It is impossible within the constraints of JavaScript and HTML.

You generally do not want auto focus on virtual-keyboard devices because it will pop the keyboard. However I do agree that pressing reply should always set focus to the reply area @eviltrout, regardless of touch support and it sounds like it used to work this way so possibly another regression with composer.


(Joshua Rosenfeld) #4

@codinghorror, this is certainly not ideal, but if there is no way to detect whether a device with a touch input is a tablet or an external monitor, could we have a device specific setting (like desktop notifications) to indicate that a device is a laptop/desktop and we do not want any touch centric UI changes?


(Mittineague) #5

I’m wondering how the detection happens in the first place.

From what I could find, Discourse uses the browser’s navigator object properties.

Assuming the browser gets information about the system environment it’s running in, wouldn’t this be a browser issue or possibly OS configuration that is outside of the scope of Discourse?


(Lee Griffin) #6

There is no way to detect if something is multi-touch, no but you can set an active listener to keep a flag set for what input someone is using.

If someone moves the mouse they are using non-touch input. If someone touchstarts the screen they are using touch. If you were to set a flag on this basis you could provide the most appropriate response to user interaction based on what they’re actually doing, rather than be trying to detect what kind of device they have :smile:

Edit: Of course this may be unnecessary in the grand scheme of things as you say… focus on the input area makes sense for all device types, just something to consider going forward!


(Robin Ward) #7

Okay so this is where it’s tricky. Pretty much all the iPad regressions with the new composer were due to setting focus() on things in a position: fixed area on iOS 8+.

I know the old composer didn’t have the same issues, which is super confusing to me. The best I can reason is that it had a different layout that didn’t make it suffer the same problems?

Perhaps we could just remove auto focus on iOS devices rather than all touch?


Attempt to filter category on topic edit results in modifying title
(Robin Ward) #8

Okay I’ve adjusted the iOS hacks to reflect that they are really for iOS, not touch in general:


(Jeff Atwood) #9

This topic was automatically closed after 2 days. New replies are no longer allowed.