tomvanenckevort / Codery.TextCount

Umbraco data type which wraps existing text data type controls and shows text counts and limits while you type.
1 stars 3 forks source link

fixed bug with isolated scope #2

Closed wiedikerli closed 7 years ago

wiedikerli commented 7 years ago

There is an error in firefox when sharing scope between controller and directive. I moved all the directive code into the controller.

Maybe there's a better solution, but this one is working for me.

shrug

tomvanenckevort commented 7 years ago

Thanks for your PR.

Generally it's not good practise to interact with DOM elements in AngularJS controllers, that's what the directive's role is. So rather than moving the code from one place to another as per your PR, I'd rather get to the bottom of the problem and see if there's another way to fix it.

Can you describe what the issue is you're seeing in Firefox? Any console errors in the developer tools? Also can you tell me which version of Firefox and which version of Umbraco you are using?

wiedikerli commented 7 years ago

I dont want to role back, but as far as I remember it was something like this: https://stackoverflow.com/questions/22663861/two-directives-requesting-isolated-scope-and-inherited-scope-on-the-same-element https://stackoverflow.com/questions/17111016/angularjs-access-isolated-scope-in-directives-link-function

Umbraco: 7.6.3 Firefox: 47.0.2

tomvanenckevort commented 7 years ago

Is there any reason why you use an older version of Firefox? v47 is from June 2016. I can replicate the issue in that browser, but when I try it in the latest version (v54) it is working fine.

tomvanenckevort commented 7 years ago

Investigating the issue a bit more led me to this issue in AngularJS, where a workaround was suggested to change the directive priority order.

So this is what I have done now and a new version of TextCount (v1.0.10.0) is now available.

Thanks for reporting the issue!