Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popover not focused when closing in IE throws error. #1432

Closed
antkohan opened this issue Apr 7, 2017 · 5 comments
Closed

Popover not focused when closing in IE throws error. #1432

antkohan opened this issue Apr 7, 2017 · 5 comments

Comments

@antkohan
Copy link

antkohan commented Apr 7, 2017

OpenUI5 version:

Browser/version (+device/version): Internet Explorer / 11.839.10586.0

Any other tested browsers/devices(OK/FAIL): Chrome (OK)

I have a sap.m.Popover that contains a list of rows, and each row has a cancel icon that, when pressed, removes it from the list. When the last row is removed, the popover is closed. However, in IE the popover appears not to regain focus before closing and a "get id of undefined" error is thrown. The error comes from a "document.activeElement.id" line in the popover's close function because document.activeElement may be null at that point.

error
error_2

@Shtilianova
Copy link
Contributor

Hello @antkohan ,
Could you please provide and jsbin example where the issue is reproducible?
Regards,
Diana

@Shtilianova
Copy link
Contributor

Since there is no response from the author for more than 4 weeks I'm closing the ticket.

@pygy
Copy link

pygy commented Aug 22, 2017

@Shtilianova document.activeElement can be null or document.body when no element is focused. Most browsers set it to document.body, but IE sets it to null. @antkohan is correct, a null check is needed unless you know that an element has the focus.

Edit: Here's the same issue in another lib... Note that I'm not an OpenUI5 user, I found this while doing research for similar report for a lib I'm contributing to.

angular/components#2760

@stephania87
Copy link

@pygy and @antkohan , Here is an example with custom handling of deletion, working with the latest OpenUI5 version - https://jsbin.com/yowapeyaje/1/edit?html,output
Please elaborate further how the problem is reproducible.
Thank you

@stephania87
Copy link

I am closing this one as there is no activity in the thread. Feel free to open a new thread linking this issue, if you want to continue the discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants