digideskio / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
0 stars 0 forks source link

Shift Selecting multiple rows in ScrollTable selects the text as well (IE only) #67

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a ScrollTable with a SelectionGrid as the dataTable 
2. Set Multirow selection policy
2. Fill it with data
3. Try to shift-select multiple rows

What is the expected output? What do you see instead?
The text is selected along with the Rows.  It shouldn't select the text.

What version of the product are you using? On what operating system?
Incubator trunk + IE7

Please provide any additional information below.

Original issue reported on code.google.com by Luminari...@gmail.com on 3 Mar 2008 at 10:47

GoogleCodeExporter commented 8 years ago
Why? Many people shift selecting html tables actually are copying the date out 
of the
table, so why would we want to disable that?

Original comment by gwt.team...@gmail.com on 4 Mar 2008 at 2:46

GoogleCodeExporter commented 8 years ago
You already try to disable that.  There is code in there that attempts to do 
it, and
it succeeds in firefox and fails in IE.

The problem is that if you shift-select elements in the table, from the bottom 
to the
top, it actually often selects the whole page (or large parts of it) and turns 
it
blue.  That totally breaks the integrity of the interface.  There is still 
nothing
stopping someone from click-dragging to select, since that isn't a shift-select.

Original comment by natequ...@gmail.com on 5 Mar 2008 at 3:21

GoogleCodeExporter commented 8 years ago
If we do it in one case, we should certainly do it in the other then. 

Original comment by gwt.team...@gmail.com on 7 Mar 2008 at 4:33

GoogleCodeExporter commented 8 years ago

Original comment by sumitcha...@google.com on 2 May 2008 at 5:47

GoogleCodeExporter commented 8 years ago
The following is a solution to the problem.  Create two jsni functions:

public static native void preventIESelection() /*-{
        $doc.body.onselectstart = function () { return false; };
    }-*/;

public static native void enableIESelection() /*-{
    if ($doc.body.onselectstart != null)
        $doc.body.onselectstart = null;
    }-*/;

Then in the SelectionGrid class after the following line do: 

if (ctrlKey || shiftKey) {
   preventIESelection();

and at the beginning of onBrowserEvent call enableIESelection();

This may not be the best implementation of the solution but it works.

Original comment by Luminari...@gmail.com on 4 Jun 2008 at 7:26

GoogleCodeExporter commented 8 years ago
The same issue appears in IE 9 with GWT 2.4.0.
Is there any solution beside recompiling GWT's source code?

Original comment by sasabo...@gmail.com on 4 Sep 2012 at 9:38