Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4200 closed defect (fixed)

OSK Backspace does not work on the OLPC home page when not focusing the entry explicitly

Reported by: humitos Owned by: humitos
Priority: Normal Milestone:
Component: Browse Version: 0.97.x
Severity: Major Keywords: r+
Cc: humitos, manuq Distribution/OS: OLPC
Bug Status: Assigned

Description (last modified by erikos)

Steps to reproduce it:

  1. Go to the eBook mode
  2. Open a new instance of Browse (the OLPC landing page is loaded)
  3. OSK keyboard is shown
  4. Start typing something (the characters appear in the google search entry on the page)
  5. Press "Backspace" from the OSK

Second test case:

  1. Go to the eBook mode
  2. Open a new instance of Browse (the OLPC landing page is loaded)
  3. OSK keyboard is shown
  4. tap into the google search field
  5. Start typing something (the characters appear in the google search entry on the page)
  6. Press "Backspace" from the OSK (the characters are deleted correctly)

Environment:

XO-4 13.1.0 build 11

Attachments (3)

focus-button-osk-javascript.html (682 bytes) - added by humitos 8 years ago.
Grab the focus on click
focus-initial-osk-javascript.html (788 bytes) - added by humitos 8 years ago.
Grab the focus at startup
0001-Hanlde-focus-properly-on-each-tab-SL-4200.patch (2.0 KB) - added by humitos 8 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 8 years ago by humitos

I've just noticed that if you do as a 6) step:

  1. Tap on the Stop button

The OSK will persist after Browse is closed and will keep over the Home View.

comment:2 Changed 8 years ago by erikos

  • Description modified (diff)
  • Summary changed from OSK Backspace does not work on the Home page to OSK Backspace does not work on the OLPC home page when not focusing the entry explicitly

I adjusted the steps for reproduction. Looks like a focus issue.

comment:3 Changed 8 years ago by erikos

  • Description modified (diff)

comment:4 Changed 8 years ago by erikos

As well the blinking cursor, that indicates which entry has the focus is not shown in the google entry.

comment:5 Changed 8 years ago by humitos

I think the Home Page needs to be re written because there are many HTML errors on its code. This could be reason (one of... at least) of this issue but I'm not sure yet.

I write two clean HTML test cases that grab the focus at startup and the other grab the focus when "Click me!" button is clicked. Both of them work without problem. See attachments.

Changed 8 years ago by humitos

Grab the focus on click

Changed 8 years ago by humitos

Grab the focus at startup

comment:6 Changed 8 years ago by erikos

Thanks Humitos for those test cases, I just tried them here. For me the second one shows the same issue then the OLPC home page: I resume the page in Browse, the OSK is shown, the entry does not look focused, but when I type on the OSK the characters are shown, same as in the OLPC home page the backspace button does not work.

comment:7 Changed 8 years ago by humitos

Well, the problem is when the page is loaded at startup. I could reproduce this doing

  1. Open Browse
  2. Go to http://google.com
  3. Close Browse
  4. Resume the instance

You can start typing with the OSK but backspace does not work.

comment:8 follow-up: Changed 8 years ago by erikos

  • Keywords triage removed
  • Milestone changed from Unspecified by Release Team to 0.98
  • Priority changed from Unspecified by Maintainer to Normal
  • Severity changed from Unspecified to Major
  • Version changed from Unspecified to 0.97.x

Yes, but this suggests that the issue is not in the javascript, correct?

comment:9 in reply to: ↑ 8 Changed 8 years ago by humitos

  • Owner changed from manuq to humitos
  • Status changed from new to accepted

Replying to erikos:

Yes, but this suggests that the issue is not in the javascript, correct?

You are right. Javascript is not the problem. If you open a new instance of browse and go to the url entry, then press Enter (from the OSK) the focus is put on the Google input form and it works properly.

Taking this in mind, I have more information to research and I can take a look at it. So, I'm accepting it.

comment:10 Changed 8 years ago by erikos

  • Bug Status changed from Unconfirmed to Assigned

Ok, I have a test case that gets things more clear:

  • in laptop mode
  • open a new Browse instance
  • load google.com
  • close Browse instance
  • resume it
  • type with your hw keyboard

---> the google entry does not receive any characters, visually it looks unfocused

The issue we have is that the webview is not focused. Here is a simple patch that does fix the above test case.

diff --git a/webactivity.py b/webactivity.py
index d140128..e9847d4 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -371,6 +371,7 @@ class WebActivity(activity.Activity):
             for number, tab in enumerate(self.model.data['currents']):
                 tab_page = self._tabbed_view.get_nth_page(number)
                 tab_page.browser.set_history_index(tab['history_index'])
+                tab_page.browser.grab_focus()
 
             self._tabbed_view.set_current_page(self.model.data['current_tab'])
         elif self.metadata['mime_type'] == 'text/uri-list':

This does make the same est case work as well in ebook mode actually.

Humitos, can you prepare us a patch based on the above that handles all the cases correctly? a) new Browse instance b) resume a Browse instance with several tabs, the active tab should get the focus here [...]

comment:11 Changed 8 years ago by humitos

  • Cc manuq added
  • Keywords r? added

This patch grabs the focus when the Home page is load and put the cursor inside the Google search entry. With this change the OSK is shown when the XO is in eBook mode and when is not we are able to type with the HW keyboard.

The same behaviour happens when the user resumes other pages, like Google or another that has a field that it's focused automatically with javascript on pageload.

comment:12 Changed 8 years ago by erikos

Thanks for the patch Humitos. I think it does what it should. I came across one issue. Not sure it is exactly related but might be another focus/defocus one.

  • open a tab
  • load google.de

---> the search entry is focused and the osk appears

  • in the same tab, load 'erde.de' (a page without a search entry or similar)

---> the OSK does not go away

comment:13 Changed 8 years ago by erikos

  • Keywords r+ added; r? removed
  • Resolution set to fixed
  • Status changed from accepted to closed

Pushed the patch as: 9ac0a9e44f2b866cc4ec9a2fbac7c09c77ecb2f4

Open issue is tracked in #4248

comment:14 Changed 8 years ago by dnarvaez

  • Milestone 0.98 deleted

Milestone 0.98 deleted

Note: See TracTickets for help on using tickets.