Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

select element can't get focus inside a contentEditable div.

271 views
Skip to first unread message

akin

unread,
Nov 25, 2011, 11:33:23 PM11/25/11
to
When I write a div with attribute "contentEditable=true' ,then
I put a "<select><option>...</select>" inside this div,but the select
element just can not be set focus,so I can't use it to chose a
value.It made me feel difficult to design a online medical record
editor.... ,any idea are appreciated.

Neil

unread,
Nov 27, 2011, 11:00:49 AM11/27/11
to
akin wrote:

>When I write a div with attribute "contentEditable=true', then I put a "<select><option>...</select>" inside this div, but the select element just can not be set focus, so I can't use it to chose a value. It made me feel difficult to design a online medical record editor...., any idea are appreciated.
>
>
This is because the select is editable too! If you want to be able to
provide a list of values to embed within editable text, then try setting
contenteditable="false" on the select element.

--
Warning: May contain traces of nuts.

akin

unread,
Nov 28, 2011, 2:07:26 AM11/28/11
to
Thank u Neil.
I have set the attribute contenteditable="false",In firefox the
select element now can be set focus and can not be delete now,that is
not what I want.Other elements like <input> can be deleted even they
have been set the attribute contenteditable="false".
In safari, the element <select> with attribute
contenteditable="false" can get focus and can be deleted,that is the
result I want.

Neil

unread,
Nov 28, 2011, 4:37:43 AM11/28/11
to
akin wrote:

>On 11月28日, 上午12时00分, Neil <n...@parkwaycc.co.uk> wrote:
>
>
>>akin wrote:
>>
>>
>>>When I write a div with attribute "contentEditable=true', then I put a "<select><option>...</select>" inside this div, but the select element just can not be set focus, so I can't use it to chose a value. It made me feel difficult to design a online medical record editor...., any idea are appreciated.
>>>
>>>
>>This is because the select is editable too! If you want to be able to provide a list of values to embed within editable text, then try setting contenteditable="false" on the select element.
>>
>>
>I have set the attribute contenteditable="false", In firefox the select element now can be set focus and can not be delete now, that is not what I want. Other elements like <input> can be deleted even they have been set the attribute contenteditable="false".
>
>
<input contenteditable="false"> doesn't actually seem to have any
effect. (That looks like a bug.) So the reason you can delete the
<input> is because Firefox still thinks it's editable.

>In safari, the element <select> with attribute contenteditable="false" can get focus and can be deleted, that is the result I want.
>
>
This seems to be bug 685445.
0 new messages