From: nick on
On May 7, 6:17 pm, Garrett Smith <dhtmlkitc...(a)gmail.com> wrote:
> nick wrote:
> > On May 7, 12:00 pm, Laser Lips <loudsphi...(a)gmail.com> wrote:
> >> I do not think it is possible.
>
> > That makes me sad.
>
> > Second opinions?
>
> Calling focus() on an option does not bring it into focus.
>
> Dispatching a click event or mousedown event doesn't pop the select open.
>
> Seems to be not possible.

Thanks for the follow-up, Garrett. I'll have to look into dispatching
mouse events; was not sure whether that could be done.

From: nick on
> The only way to click a selectbox's option could be to simulate a select
>
> quick and not finish example [...]

Hmm, I hadn't thought of that approach. Those mock-dropdowns have been
around for years... I wouldn't be surprised if they were originally
inspired by the ie5/6 <select> z-index bug. I might consider doing
something like this, although it's probably overkill for the thing I'm
working on. Thanks.
From: David Mark on
nick wrote:
>> The only way to click a selectbox's option could be to simulate a select
>>
>> quick and not finish example [...]
>
> Hmm, I hadn't thought of that approach. Those mock-dropdowns have been
> around for years... I wouldn't be surprised if they were originally
> inspired by the ie5/6 <select> z-index bug. I might consider doing
> something like this, although it's probably overkill for the thing I'm
> working on. Thanks.

Be very careful of faux form controls. They are virtually always
accessibility liabilities (which can turn into legal liabilities in some
countries).
From: nick on
On May 8, 10:07 pm, David Mark <dmark.cins...(a)gmail.com> wrote:

> Be very careful of faux form controls.  They are virtually always
> accessibility liabilities (which can turn into legal liabilities in some
> countries).

Good point. I don't really like the idea of fake form controls either,
especially ones that just mimic real form controls. It seems
superfluous.

I'm working on another Chrome extension. I want to pop the dropdown
open when the user clicks its containing <label>. Every input in my
form (kind of like the awful new toolbar things in MS Word, except it
kind of works here) is in a label (styled as a button), and when I
click the label, the browser acts as if I've clicked the form
element ... with the exception of <select>. Text inputs are focused,
file dialogs pop up, etc. I want something similar to happen when the
user clicks the dropdown's label, but adding a fake form control for
this small convenience sounds like a bad idea.
From: SAM on
Le 5/9/10 8:49 AM, nick a �crit :
> On May 8, 10:07 pm, David Mark <dmark.cins...(a)gmail.com> wrote:
>
>> Be very careful of faux form controls. They are virtually always
>> accessibility liabilities (which can turn into legal liabilities in some
>> countries).
>
> Good point. I don't really like the idea of fake form controls either,
> especially ones that just mimic real form controls. It seems
> superfluous.
>
> I'm working on another Chrome extension. I want to pop the dropdown
> open when the user clicks its containing <label>.

<label onmouseover="dropDown(this)" for="select_1">
blah blah ... ... :
<select id="select_1"
onclick="dropUp(this); doThat(this)">
... ...
</label>


function dropDown(what) { what.className = 'open';
var s = document.getElementById(what.getAttribute('for'));
s.size = s.length; }

function dropUp(what) { what.tagName=='label'?
what.className = '' : what.parentNode.className = ''; }


maybe ?
and with good css rules ? in this idea :

label { position: relative; border: 3px outset; background:#fff; }
label select { position:absolute;width:100%;display:none}
label.open select { display:block }
label.open select option:hover { background:#ff7 }

> Every input in my
> form (kind of like the awful new toolbar things in MS Word, except it
> kind of works here) is in a label (styled as a button), and when I
> click the label, the browser acts as if I've clicked the form
> element ... with the exception of <select>. Text inputs are focused,
> file dialogs pop up, etc. I want something similar to happen when the
> user clicks the dropdown's label, but adding a fake form control for
> this small convenience sounds like a bad idea.

What you want isn't it a context menu ?
(I don't know Words, so I can't see its terrrific icon's dropdown)

--
sm