Transmitting the event to parent element

Hi! It is possible to organize the same behavior for touch devices as for non touch devices in "view:list"?

Example:
If you scroll to the end of the list, the scroll event will be passed on to the parent.
If you scroll on touch devices, there is no such behavior, which in some cases may affect the negative user experience.
https://snippet.webix.com/oyk24i9i

Non touch:

Touch:

Tagged:

Comments

  • Hey @lBeJIuk, I don't really see a way of achieving this on a touch device unfortunately, as this behaviour is specific to the browser only, and it would be pretty hard to replicate (if at all possible).

  • @Dzmitry
    Maybe I misrepresented the problem. But that's how HTML scroll works. If the nested view can be scrolled - scroll works on this view. If the scroll is impossible - then a parent element will be selected as a target for the scroll.
    https://snippet.webix.com/9nzhge4z

    But with the webix components, it's not like that, which makes it impossible to see the content completely under certain conditions.
    https://snippet.webix.com/arkszz6q

  • edited September 16

    As a solution, I can suggest that the existing "_is_scroll" method be modified to a new one.
    Here's an example of how a new method could look: (a new configuration "myAwesomePropagate" should be added, which shows whether the transfer should be made to the parent)

    _is_scroll: function (locate_mode) {
        var
          node = Touch._start_context.target,
          webixEl,
          scrollState
        ;
        if (!env.touch && !env.transition && !env.transform) return null;
    
        while (node && node.tagName != 'BODY') {
          if (node.getAttribute) {
            var mode = node.getAttribute('touch_scroll');
            if (mode && (!locate_mode || mode.indexOf(locate_mode) != -1)) {
              if (mode === 'y') {
                if (Touch._current_context && Touch._start_context) {
                  webixEl = $$(node);
                  if (webixEl.getScrollState) {
                    scrollState = webixEl.getScrollState();
                    if (Touch._current_context.y - Touch._start_context.y > 0) {
                      // finger movement from top to bottom
                      if (Math.abs(scrollState.y) === 0 && webixEl.config.myAwesomePropagate) {
                        node = node.parentNode;
                        continue
                      }
                    } else {
                      // finger movement from bottom to top
                      if (((webixEl._dataobj.clientHeight - webixEl.$height) - 2) 
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!