vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

ReferenceError: onshow_callback is not defined in Firefox #735

Open sinall opened 6 years ago

sinall commented 6 years ago

Steps to reproduce the issue in Firefox.

  1. Add onshow="onshow_callback" attribute on form element
  2. Add dropdown-menu in form
  3. Click Edit button, everything is OK, the callback is triggered correctly.
  4. Click dropdown-menu, it doesn't show. Console shows: ReferenceError: onshow_callback is not defined

jsfiddle example

ckosloski commented 6 years ago

This is a strange one. It works in chrome/safari but not Firefox. I tried a bunch of things, but couldn't get it to work in Firefox. It's as if bootstrap/jquery is hijacking the click event meant for xeditable, or maybe xeditable is handling it, but it then falls through to bootstrap/jquery.

sinall commented 6 years ago

@ckosloski it could work if the dropdown-menu is created by angular-bootstrap library.

ckosloski commented 6 years ago

I can see if I can get something added in the next couple of weeks. Or, your welcome to create a PR yourself :)

ckosloski commented 6 years ago

@sinall how do you plan to use the dropdown-menu in an editable form?

sinall commented 6 years ago

@ckosloski I use it to refresh the select list and view/create new item. The 'select' and dropdown-menu stay in a row.

ckosloski commented 6 years ago

@sinall so the inputs are linked? An item is selected in the dropdown-menu and this populates the select with values? Then a value is in the chosen in the select and the form submitted?

sinall commented 6 years ago

The inputs are editable-select, a dropdown menu is next to it. The items in the select could be viewed/created/refreshed by choosing one of the dropdown menu item.

ckosloski commented 6 years ago

Maybe two editable-select's with e-ng-change would work for you? I updated the jsFiddle from #521 here

sinall commented 6 years ago

Doesn't work on firefox, did you change the code? I can not find 'e-ng-change'.

ckosloski commented 6 years ago

Sorry, I pasted the wrong link. Try this one

sinall commented 6 years ago

I tried several times. But it doesn't display correct.

It shows like this:

Brand: Ford

Model: havent selected

car { "brand": "Ford", "model": "havent selected" }

brands [ { "value": "Ford", "text": "Ford" }, { "value": "Toyota", "text": "Toyota" }, { "value": "Nissan", "text": "Nissan" } ]

models{ "Ford": [ "Focus", "Fiesta" ], "Toyota": [ "Camry" ], "Nissan": [ "Siesta", "Sentra" ] }

ckosloski commented 6 years ago

OK, so it seems there is an issue with the value being initially set.. If you select Toyota, then select Model, it only shows Camry.