Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Disable dataview scroll when select + dblclick selection

  1. #1
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default Answered: Disable dataview scroll when select + dblclick selection

    Is possible disable scroll when you select item in dataview? I've custom logic in beforeItemClick event however when you click on item which isnt fully visible on the screen, container scroll and e.target is whole view item instead of clicked point.

    Is possible avoid text selection in dataview when you dblclick with small delay? e.stopEvent doesnt help.

  2. Focus feature could be disable with: focusable: false

    If I could ask you to create feature request for enableTextSelection, it would be great.

  3. #2
    Sencha User Phil Guerrant's Avatar
    Join Date
    May 2011
    Location
    Colorado
    Posts
    352
    Answers
    32

    Default

    You could try:

    Code:
    myDataView.getEl().unselectable();
    Phil Guerrant
    Ext JS - Development Team

  4. #3
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    Thanks Phil, this works like a charm for selection. Do you think is possible add this feature to config?

    Whats about scrolling? Any hint?

    Thanks in advance

  5. #4
    Sencha User Phil Guerrant's Avatar
    Join Date
    May 2011
    Location
    Colorado
    Posts
    352
    Answers
    32

    Default

    Ext.view.Table already has a way to configure text-selectability (enableTextSelection: true - it is disabled by default for grids). We could maybe consider moving that config upward to Ext.view.View, with a different default value...

    As far as scrolling - the reason it scrolls the item into view is because the item receives focus when clicked/selected. This is native browser behavior and there's not much we can do to prevent it. You could try saving the scroll position on mousedown and restoring the scroll position in response to the next scroll event, but that would likely result in a noticeable flicker in some browsers.
    Phil Guerrant
    Ext JS - Development Team

  6. #5
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    I tried put enableTextSelection: false to my dataview but it does not work. The unselectable function called after render works well. Tested on 5.1.0.50

    So problem is in focus on element? If I do same thing in http://try.sencha.com/extjs/4.0.7/ex.../view/chooser/ nothing happen when I click on element which isnt fully displayed. Part of the selected image is still under bottom toolbar. I didnt dive deeper in code but I think it isnt browser behaviour but new feature in core.

  7. #6
    Sencha User Phil Guerrant's Avatar
    Join Date
    May 2011
    Location
    Colorado
    Posts
    352
    Answers
    32

    Default

    enableTextSelection is currently only available on Ext.view.Table (grid and tree views), but not on Ext.view.View currently.

    In v5, for accessibility reasons view items receive focus when selected. The accessibility improvements in v5 make it much easier to make ARIA/screen-reader-friendly applications.

    This was not the case in v4 (the item did not receive focus when selected), which is why you don't see the item scroll into view there.
    Phil Guerrant
    Ext JS - Development Team

  8. #7
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    Thanks for explanation. Could you create feature request for unselectable dataview please?

    Focus is nice feature however in some cases is really bad - e.g. you want click on element inside dataview and when you thing you really click on element, view scrolls and you click on whole item container not a element inside. I will take a look on it but in my opinion it would be great to have focus configurable if you cant prevent to container scroll.

  9. #8
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    Focus feature could be disable with: focusable: false

    If I could ask you to create feature request for enableTextSelection, it would be great.

  10. #9
    Sencha Premium Member mistik1's Avatar
    Join Date
    Apr 2008
    Location
    Moneague, St. Ann, Jamaica W.I.
    Posts
    16

    Default

    Quote Originally Posted by Phil Guerrant View Post
    enableTextSelection is currently only available on Ext.view.Table (grid and tree views), but not on Ext.view.View currently.

    In v5, for accessibility reasons view items receive focus when selected. The accessibility improvements in v5 make it much easier to make ARIA/screen-reader-friendly applications.

    This was not the case in v4 (the item did not receive focus when selected), which is why you don't see the item scroll into view there.
    This new selection feature in v5 is killing us over here.

    I am being affected by this problem in my grid with rowexpander, if you have a large rowbody the grid will always scroll back to the top of the row when you click anything inside the rowbody, why in the world does the expander icon need to take focus along with every cell in my grid?

    I have no cell based selection model yet they all take focus away from my rowbody.

    How do I turn off the aria focusing behavior, v5 has made my grids useless?
    Lead Developer
    Tracking Solutions Inc.
    http://www.kuriosbytsi.com

    Lead Developer
    The Open Octave Project (FOSS)
    http://www.openoctave.org

  11. #10
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769
    Answers
    38

    Default

    As I wrote:
    Code:
    focusable: false

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •