-
Notifications
You must be signed in to change notification settings - Fork 58
unbind 'blur' in cancelValidation() #28
Comments
The biggest reason of the You should perhaps try using the |
Also by the way, the error messages are only showing if the element is |
Ok, i've created http://plnkr.co/edit/x6AI9U8mGF0P4NMVmzvR?p=preview see second input , tooltip does not disappear, because blur is unbind by cancelValidation(). but in first input all ok, because "required". |
i've beenn updated this comment @ghiscoding I could be wrong, but may be we can something like: add "watch" and when input empty set $setPristine(); for input. ? I think unbind 'blur' too radical decision, that affects other modules |
- Fixed issue #28 - unbind all 'blur' in cancelValidation() might affect other modules
This should fix it... |
it is does not helped, see http://plnkr.co/edit/x6AI9U8mGF0P4NMVmzvR?p=preview with 1.3.19 |
Well I am not doing a full unbind anymore so I don't think it comes from my end, you could even remove the unbind from my code and it would still work. Try debugging it and see what can cause it... If you want to debug my code, you should use the non-minified versions. |
i h've been commented this line and tooltip is disappeared.
also, i don't have any "fail on a non-required element that is now dirty & empty" (with dirty & empty input). |
hm, i've been debug and i see, that blurHandler is undefined. (thats why ubnind disable all blur handlers)/ i think, it because cancelValidation() run before elm.bind. |
it is not suppose to be undefined, it's a global variable and is set at the bind calling, unless it's unset on first pass. You could try commenting out that line (unbind) and see if that really is your problem. I still need to unbind it somehow because I might end up with 50 calls at the end. |
validation-directive.js so, we call "elm.unbind('blur', blurHandler); " with undefined blurHandler. |
it's really my problem |
Could you try the following // replace this line
elm.unbind('blur', blurHandler);
// with these lines
if(typeof blurHandler !== "undefined") {
elm.unbind('blur', blurHandler);
} I am at work and I cannot really test it, it would help if you can test it with your code too. |
@ghiscoding |
Ok I will make more tests tonight and will also fix another open issue at the same time. You should expect to see the new code and the minified code on the next version 1.3.20 later tonight. Thanks |
As promised, I push the code after testing... Hopefully that works for you |
I think, obj.commonObj.elm.unbind('blur'); in cancelValidation() is wrong.
FE, I have a angular-strap tooltip, which triggered on blur event. When i have input field with validation="max_len:50" and empty value when lost focus blur does not work and tooltip does not disappear, because blur is unbind.
The text was updated successfully, but these errors were encountered: