搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Firefox 35 & 36 on Mac don't select listboxes (html select) created by javascript / jquery, unless I set focus programmatically or I right-click on it.

more options

I am creating a single page app and newly created <select></select> does not work. It seems the problem is these select do not get focus when I click on it. If I (1) set focus programmatically; or, (2) rigth-click on it, it works normally. Firefox 35 / 36 on Mac OSX 10.10.2.

I am creating a single page app and newly created <select></select> does not work. It seems the problem is these select do not get focus when I click on it. If I (1) set focus programmatically; or, (2) rigth-click on it, it works normally. Firefox 35 / 36 on Mac OSX 10.10.2.

被選擇的解決方法

Got it!

I was using the jquery-ui's deprecated function .disableSelection() . It should disallow users to select text, but seems to give this collateral effect on FF.

I will try a CSS alternative suggested here .

Thanks!

從原來的回覆中察看解決方案 👍 0

所有回覆 (9)

more options

I've called the big guys to help you. Good luck.

What job does your app do? Any other problems / issues?

more options

Do you have a link to a publicly available page or test case demonstrating the problem? (I could only test on Windows myself.)

more options

Hi, there. I tried to make a simple sample case... but it worked. My application is a backbone based dashboard panel. The problem occurs in some special condition I am trying to replicate. I the following links it was related to jquery.ui.modal window and datepickers. It is not my case, but I guess I am using something similar to modal windows.

I guess to case are related: 1. Select does not open dropdown onclick 2. Month select in datepicker inside a bootstrap-modal won't work in Firefox

If I succeed replicating the case, I will post it here.

Thanks!

由 floridia 於 修改

more options

選擇的解決方法

Got it!

I was using the jquery-ui's deprecated function .disableSelection() . It should disallow users to select text, but seems to give this collateral effect on FF.

I will try a CSS alternative suggested here .

Thanks!

more options

Anyway, the FF behaviour is not fine. Disabling text selection should not disable the dropdowns...

more options

Hi floridia, if you compare the CSS in Firefox's Inspector between your two versions, what rules are being used to disable selection? Some of the proprietary -moz properties can definitely cause problems.

more options

Hi jscher2000,

It seems it works by capturing the event and dropping it out...

From jquery-ui core:

(...) disableSelection: function() { return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" )

Could it be because there is no "selectstart" event, so it uses the "mousedown" instead ?

I didn't find that CSS rules in the inspector...

more options

According to this site , FF and Opera don't have the selectstart event...

more options

floridia said

Could it be because there is no "selectstart" event, so it uses the "mousedown" instead ?

I didn't find that CSS rules in the inspector...

I think that's right.