| Summary: | [Button] Checkbox does not prevent Space key from being propagated to parent widget | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Rüdiger Herrmann <ruediger.herrmann> | ||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 1.5 M4 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Rüdiger Herrmann
Created attachment 208088 [details]
Project to reproduce this bug
Probably related to the fact that when key listener is attached on the server, the DOM key event is always canceled first on the client and than re-fired programatically if it is allowed from the server. Should be interesting if it is reproducible with simple Table with a check box over an item - no TableViewer, no key events involved. (In reply to comment #2) > Probably related to the fact that when key listener is attached on the server, > the DOM key event is always canceled first on the client and than re-fired > programatically if it is allowed from the server. Should be interesting if it is > reproducible with simple Table with a check box over an item - no TableViewer, > no key events involved. Though your theory sounds reasonable, the behavior is also reproducible with a check box within a simple table. I added these lines to the TableTab: Button button = new Button( table, SWT.CHECK ); button.setText( "TEST BUTTON ON A TABLE " ); button.setLocation( 40, 40 ); button.pack(); Hitting the space key on the check box also changes the checked state of the table item. Created attachment 208091 [details]
Proposed patch against CVS HEAD
In BasicButton.js the key event for Enter/Space has been stopped from propagation for "keypress" DOM event too (like "keyup"/"keydown") which is used by Tree/Table.
Thanks for the patch, Ivan. I applied it to the Tree_Table_Merge branch. I think events for the Enter key should also be not propagated as - like the Space key - they are handled by the BasicButton itself. What do you think? (In reply to comment #5) > I think events for the Enter key should also be not propagated as - like the > Space key - they are handled by the BasicButton itself. What do you think? Yes, I think so too... and stop propagation of Enter key event is also included in the patch. :-) (In reply to comment #6) > (In reply to comment #5) > > I think events for the Enter key should also be not propagated as - like the > > Space key - they are handled by the BasicButton itself. What do you think? > Yes, I think so too... and stop propagation of Enter key event is also included > in the patch. :-) Sorry, I must have missed this somehow. Applied patch to HEAD, too. |