[TIMOB-16957] iOS : Opening popover on iPad breaks focus/blur events of the current window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-02T16:49:01.000+0000 |
Affected Version/s | Release 3.2.3 |
Fix Version/s | Release 3.3.0, Release 3.4.0 |
Components | iOS |
Labels | module_popover, qe-manualtest, qe-testadded |
Reporter | Andrey Pervushin |
Assignee | Pedro Enrique |
Created | 2014-05-12T15:52:17.000+0000 |
Updated | 2014-08-15T22:57:40.000+0000 |
Description
example:
var win = Ti.UI.createWindow();
win.addEventListener('focus', function(){
Ti.API.log('focus');
});
win.addEventListener('blur', function(){
Ti.API.log('blur');
});
var button = Ti.UI.createButton({title: 'Open Popover!'});
button.addEventListener('click', function(e){
popover.show({ view: button });
});
win.add(button);
var view = Ti.UI.createView({backgroundColor: 'green'});
view.add(Ti.UI.createLabel({text: "It's not easy being green."}));
var rightButton = Ti.UI.createButton({title: 'Robin'});
rightButton.addEventListener('click', function(e){
alert("But green's the color of spring.");
});
var popover = Ti.UI.iPad.createPopover({
width: 250,
height: 100,
contentView : Ti.UI.createWindow({}),
});
popover.add(view);
win.open();
Just to make sure that I understand this issue correctly, you are expecting only focus event once and no blur event on win object when popover is opened and closed. Let me know what is the output you are expecting in this case.
sure, i expect blur event from main window on open popover (wich ok at first) and focus event on popover hide (wich is not working) but the main problem that after opening popover focus/blur event of the window doesn't work at all no mater what you do (switching tabs etc)
[~rian] Thanks for the clarification.
Moving this ticket to engineering as I can reproduce the issue with the provided test case.
Is there any news on fixing it?
Resolving as suggested.
What do you mean "Won't Fix"? Why?
I honestly don't know why I resolved this as "Won't Fix." I may have resolved the wrong ticket. Reopening.
Note
Popovers are not meant to be reused. Use this code, is a refactored code from the code in the description.Test code
PR:
master: https://github.com/appcelerator/titanium_mobile/pull/5877 3.3.x: https://github.com/appcelerator/titanium_mobile/pull/5878Verified fixed on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.3.0.201406271159 Titanium SDK, build: 3.3.0.v20140702094913 Titanium CLI, build: 3.3.0-rc4 Alloy: 1.4.0-rc3 Xcode: 5.1.1 iOS Device: iPad Air (7.1.2) iOS Simulator: iPad (7.1) Used test code provided by [~penrique]. Focus and blur events of the popover window and base window successfully called multiple times.
Closing.