-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
loop calling of scope.updateSelectedStyles() after switching window #443
Comments
That's an odd bug. Thanks, I'll have a look when I can. |
I can't actually replicate this on OS X - something to do with how our windows work. I think the following should fix it, could you test it for me and let me know please? scope.updateSelectedStyles = function(){
console.log('updateSelectedStyles');
var _selection;
// test if the common element ISN'T the root ta-text node
if((_selection = taSelection.getSelectionElement()) !== undefined && _selection.parentNode !== scope.displayElements.text[0]){
_toolbars.updateSelectedStyles(angular.element(_selection));
}else _toolbars.updateSelectedStyles();
// used to update the active state when a key is held down, ie the left arrow
/* istanbul ignore else: browser only check */
if(scope._bUpdateSelectedStyles && $document.hasFocus()) $timeout(scope.updateSelectedStyles, 200);
else scope._bUpdateSelectedStyles = false
}; |
Or you can test it in the Pre-Release 17 version. |
TypeError: undefined is not a function I.e. $document does not have hasFocus() function P.S. Chrome version 39.0.2171.95 (64-bit) |
I tried the following and it helped in IE11, Chrome, FireFox:
|
I.e.
|
P.S. The additional issue is found. When a page URL is copied in IE11, then a loop calling of scope.updateSelectedStyles() also occurs. STR:
|
Ok, I think I got it this time, try pre-release 18. |
The main issue is fixed now. But the additional issue with IE11 still exists. |
I haven't got easy access to an IE11 machine to test it, I've added another check in the pre-release 19 that may fix this. |
Unfortunately this did not help. Very strange, but when focus is at the browser's URL
keydown event is fired only after pressing Ctrl button but not for others. As a workaround _keydown function may:
IMHO 2) is better but indeed it's up to you. P.S. I would prefer something like:
... (skipped)
|
JFI: I've created the appropriate question here http://stackoverflow.com/questions/27545235/jquery-keydown-handler-receives-keydown-event-when-ctrl-is-pressed-in-url-field |
2 would indeed be better, can you try something for me in the As long as that triggers correctly in IE11 I can use that, otherwise I'll use 1 - if that's possible, I'll have to check. |
yes. _focusout is called in such case. |
OK, I've added that fix into the new pre-release can you check please? |
Hello. The issue has been fixed. |
Awesome, thanks for getting back to us. |
Hello.
During #423, #424, #425 issues investigation the following small issue was found (for 1.3.0-pre15).
Chrome, FireFox
add console logging like the following:
scope.updateSelectedStyles = function(){ console.log( 'scope.updateSelectedStyles' );
click the TA's input field
switch to another window (Alt+Tab)
switch back
See in console the loop calling of scope.updateSelectedStyles()
I.e. scope._bUpdateSelectedStyles is not set to false
click the TA's input field - looping is stopped.
The text was updated successfully, but these errors were encountered: