[Bug] Select menu is slightly broken on touch screens

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Messages: 1 803
[Bug] Select menu is slightly broken on touch screens
« le 17 Mars 2012 à 21:12 »
The select menu doesn't respond to scrolling on touch screen devices
The way it's meant to be

Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 080
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #1, le 17 Mars 2012 à 21:26 »
Which is why iPhones get a much higher size. To avoid the bars.
I don't remember if I added this for tablets as well.
I dunno how a scrollbqr is supposed to be used on a touch device.

Should really create a bug board now... ;)
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Messages: 1 803
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #2, le 17 Mars 2012 à 21:28 »
Wouldn't a safer bet be to let native select menus be used on touch devices? Just test for
Code: [Sélectionner]
var isTouch = 'ontouchstart' in document.documentElement;
The way it's meant to be

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #3, le 17 Mars 2012 à 21:38 »
That seems a good compromise.
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 080
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #4, le 17 Mars 2012 à 22:42 »
Hey good test string :)

However the reason I don't do that is that sometimes we use HTML in options...
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #5, le 18 Mars 2012 à 20:24 »
I have noticed, though, that it is possibly to trip up the selectbox on things like the jumpto if you happen to have it near the bottom of the page and a lot of boards - and it's not possible to scroll on an iPod touch (or if it is, I haven't figured out how)
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 080
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #6, le 18 Mars 2012 à 22:41 »
I don't think it's possible toake it scroll. We mentioned that elsewhere today iirc. The solution is to avoid restraining height but I haven't got time to work on the select box right now.
As for tripping up you mean having it cut off on the right yeah? It's also another thing I always forget to fix. It's easy enough, I just need to reduce the left margin by the same amount of pixels.
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #7, le 18 Mars 2012 à 22:45 »
No, I did mean the whole vertical thing, haven't caused it to be cropped on the right for any reason.
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 080
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #8, le 19 Mars 2012 à 07:01 »
It happens in the admin area mostly.
As for what you describe. How's this a bug? Wedge shows the a dropup instead of a dropdown so that it doesn't get cropped..
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Messages: 1 803
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #9, le 19 Mars 2012 à 07:41 »
Citation de Nao le 18 Mars 2012 à 22:41
I don't think it's possible toake it scroll. We mentioned that elsewhere today iirc. The solution is to avoid restraining height but I haven't got time to work on the select box right now.
As for tripping up you mean having it cut off on the right yeah? It's also another thing I always forget to fix. It's easy enough, I just need to reduce the left margin by the same amount of pixels.
It'll require some tricky scrolling code to make it scrolling, can't you drop the HTML from options when using the native select?
The way it's meant to be

Dragooon

  • I can code! Really!
  • Talking Head
  • polygon.com has to be one of the best sites I've seen recently.
  • Messages: 1 803
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #10, le 19 Mars 2012 à 15:47 »
This isn't exactly ideal, and it will lag a lot on touch devices. But it scrolls

Code: (At the end of ScrollBar function in sbox.js) [Sélectionner]
$dd[0].addEventListener('touchmove', function (e)
{
scrollTo(startPos - e.touches[0].pageY + iTouch);
e.preventDefault();
});
$dd[0].addEventListener('touchstart', function (e)
{
iTouch = e.touches[0].pageY;
startPos = parseInt($thumb.css('top') || 0);
});
The way it's meant to be

Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 080
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #11, le 30 Mars 2012 à 15:09 »
Never got around to replying that post...
I'm still unsure what to do about this. I'm always against forcing every single browse to load code that it will never need. (Just like I'm not cool about forcing them to load ARIA stuff they'll never use either, but that's a bit harder to detect than a browser version...)

I'd like to get some opinions on this.
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #12, le 30 Mars 2012 à 15:12 »
This problem is only going to get worse as touch-capable desktops become more prevalent, so I'd be inclined to implement it like that and run with it. (Though I realise it's not the best solution.)
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


Nao

  • Madman
  • With a Box
  • If you say so.....
  • Messages: 13 080
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #13, le 30 Mars 2012 à 15:19 »
It's just that, I like having my dropdown without any scrollbar. I find this more natural... More natural, even, than the iOS implementation.
Posté : 30 Mars 2012 à 15:19

BTW, only 5 commits left before we reach 300 commits (together) for the first quarter :)
We've already broken our record by far, anyway!
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Arantor

  • With a Box
  • I'm a shooting star leaping through the skies, like a tiger defying the laws of gravity...
  • Messages: 14 006
[Bug] Re: Select menu is slightly broken on touch screens
« Réponse #14, le 30 Mars 2012 à 15:21 »
Hmm, iOS' implementation is pretty natural, as it only shows you the scrollbar as you're scrolling, but I've wondered if there shouldn't be a visual cue that the selection area is larger than what's currently displayed.

And woohoo! 2012 is very definitely shaping up to be a helluva year for both of us!
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.