NicolasCARPi / jquery_jeditable

jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
https://jeditable.elabftw.net
MIT License
1.74k stars 458 forks source link

Select field not working on Firefox #202

Closed RepoCorp closed 5 years ago

RepoCorp commented 5 years ago

Description

I have a td element configured as an editable select input that makes a request to get the dropdown values. It works as expected on Chrome but doesn't on Firefox. In Firefox I see it makes the request and gets the right values, but the dropdown only shows the first one and seems to freeze. It doesn't let me see other values and it doesn't react to losing focus.

        $(this).editable('example.com',{
          loadurl : '/example/choices_get.json',
          type   : 'select',
          indicator:    'Saving...',
          tooltip   :   'Click to edit...',
          event: 'focus',
          onblur: 'submit'
        })

jQuery version: 1.9.1 Browser: Works on Chrome, doesn't work on Firefox OS: Various

NicolasCARPi commented 5 years ago

Do you see any error in the console? What if you remove the event option?

RepoCorp commented 5 years ago

In the console I only see a migration warning

jquery-migrate-1.4.1.js?1560789405:45 JQMIGRATE: jQuery.fn.attr('selected') might use property instead of attribute

I removed the event option and still didn't work. I tried removing other attributes from the configuration and from the element and it seems that the issue is caused by the attribute contenteditable in the td element. I need that attribute for accessibility purposes to be able to get to the element without a mouse.

NicolasCARPi commented 5 years ago

I cannot reproduce your issue. See https://codepen.io/nicolascarpi/pen/ewWpzr

Try to get a reproducible case in the codepen editor.

RepoCorp commented 5 years ago

Thank you very much @NicolasCARPi for your help and sorry for my late response.

I reproduced it here https://codepen.io/catalina-de-la-cuesta/pen/PrxjZd.

But looking for the problem I found out it's a Firefox issue, not directly related to jeditable. In the pen I added two simple selects with and without contenteditable and in Firefox the one with contenteditable doesn't work 😒.

NicolasCARPi commented 5 years ago

Yes, I can confirm it doesn't work with me with firefox either.

RepoCorp commented 5 years ago

I guess there's nothing we can do about it then 😩.

Thank you very much for your prompt response.