vitalets / angular-xeditable

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

Control deselects when navigating outside the area #757

Closed bartdk-be closed 4 years ago

bartdk-be commented 4 years ago

A lot of users complain about the fact that the control switches from "editable" to "readonly" when they click inside > move mouse outside > and release the mouse.

https://github.com/vitalets/angular-xeditable/blob/ca6d768a74f341df2ab6fe498a09fde24ec66926/src/js/editable-form/controller.js#L43

We fixed the issue on our local version by changing the OnClick to a MouseDown. If we create a pull request for this topic, any chance it can be merged into the main version ?

ckosloski commented 4 years ago

As long as all the tests pass and everything works as it should, it can be merged. I just tried to recreate what you described on the demo site, but I was unable to.

drsmog commented 4 years ago

pls review records - https://www.loom.com/share/2b01f81d1bca49c380a3727bf2147f2a

brief context: problem: when you are doing mouse up outside on input box, submit is triggering. reason: because we r listening on click event - line: 1485 - $document.bind('click', function (e) { .... solution: listen to mousedown like - $document.bind('mousedown', function (e) {

drsmog commented 4 years ago

@ckosloski pls take a look and update if that change is ok - sorry for that urgency but we are in a hurry and it cause some usability issue for our customers

ckosloski commented 4 years ago

What kind of configuration are you using for xeditable? If I go here - http://vitalets.github.io/angular-xeditable/#text-simple I can't reproduce the issue You are welcome to create a pull request.

drsmog commented 4 years ago

@ckosloski thanks for such a quick response. I was able to reproduce same on that link pls take a look - https://www.loom.com/share/5ccd44b7e58d4babbbecd8fea3a17b85

ok thats great ill push a PR

drsmog commented 4 years ago

@ckosloski i've made a PR - https://github.com/vitalets/angular-xeditable/pull/758 . pls take a look once u will have some time for that. thanks a lot 👍

ckosloski commented 4 years ago

So I was able to reproduce this in chrome, but it works correctly in firefox.

ckosloski commented 4 years ago

Please close this.