Bug 984299 - Use page visibility to close keyboard