Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ext-table: it is not possible to click a link in a cell if the containing row is not selected first #1042

Closed
classifaddict opened this issue Oct 30, 2020 · 5 comments

Comments

@classifaddict
Copy link

classifaddict commented Oct 30, 2020

My app is made of a multiple columns table in which additional column may contains some links triggering a function that open a popup window or perform other action.

Using version 2.29.x, clicking a link just open the popup window.

Using 2.30+, clicking the same link makes the row scrolling to the middle of the window (and probably select the row).
Then, only if I click the link a second time the popup window opens.

Is this a bug or is there a way to bypass the first click event using 2.30+?

Code for 2.29.x:

Tree options:
    'scrollParent': window,
    'scrollOfs': {
        'top': window.innerHeight / 2,
        'bottom': window.innerHeight / 2
    },
    'selectMode': 1,
    'click': function(e, data){
        if (data.targetType == 'expander') {
             data.node.user_collapsed = true;
        } else {
              return false;
        }
    },
    'generateIds': True,
    'activeVisible': True, 
    'aria': True, 
    'autoActivate': True, 
    'icon': False,
    'debugLevel': 2,
    'extensions': ['table', 'gridnav'],
    'table': {
        'indentation': 0,
        'nodeColumnIdx': 1
    },
    'gridnav': {
        'autofocusInput': False,
        'handleCursorKeys': True
    }

If I remove the scrollOfs option with 2.30+, the links are working as expected but I can no longer scroll a node to the middle of the window (e.g. using node.scrollIntoView({'topNode': node})).
I also tried to move scrollOfs option from the tree to each scrollIntoView call, without success.

I also tried 'unselectable': true

Note: when the row is not selected, the click event is fired only when clicking the node expander cell (second column in my case).

Environment

  • Browser type and version: Chrome 86, FF 81, Edge 86
  • jQuery and jQuery UI versions: 3.5.1
  • Fancytree versions: 2.30.0 to 2.37.0.
  • enabled/affected extensions: table, gridnav, glyph

Thanks a lot for maintaining this great FancyTree,
Olivier

@mar10
Copy link
Owner

mar10 commented Oct 31, 2020

See also #942

@stale
Copy link

stale bot commented Jan 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Flagged by stalebot label Jan 30, 2021
@classifaddict
Copy link
Author

classifaddict commented Jan 30, 2021

This issue still exists and must be addressed. Thanks.

@stale stale bot removed the stale Flagged by stalebot label Jan 30, 2021
@mar10
Copy link
Owner

mar10 commented Jan 30, 2021

Seems to be introduced with #863 in v2.30, that triggers node.scrollIntoView() when a node is activated.
Probably caused by the fact, that scrolling is triggered on mousedown, and the mouseup event does not occur at the same position.
The problem also occurs with checkboxes not beeing selected in this case.

@mar10 mar10 closed this as completed in 4622015 Jan 31, 2021
@classifaddict
Copy link
Author

Works like a charm with 2.38.0! Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants