Prevent open state when using ion-option-button


#1

Hello! Is it possible to modify (or create a sister-directive for) ion-list / ion-option-button directives to prevent the item from snapping to the open position? I want to being able to peek at the ion-option-button content but have the item always snap back to the closed position.

Any thoughts?

Thanks so much!


#2

Turns out that I can achieve a nice peek effect using ion-slide-box and only one slide, hiding content to be revealed underneath.

Does anyone know how I might prevent ion-slide-box from dragging in one particular direction? A similar question is asked here: One side slide-box

Edit
A little hack to solve my particular use case until I write some sort of directive to override:

In the ionic-views-Slider function, I changed

// ensure swiping with one touch and not pinching
    // ensure sliding is enabled
    if (event.touches.length > 1 ||
        event.scale && event.scale !== 1 ||
        slider.slideIsDisabled) {
      return;
    }

to:

// ensure swiping with one touch and not pinching
    // ensure sliding is enabled
    if (event.touches.length > 1 ||
        event.scale && event.scale !== 1 ||
        slider.slideIsDisabled

        /* --- begin HACK: PREVENT LEFT PULL ON SLIDEBOX --- */
         || (!index && (event.touches[0].pageX - start.x) > 0)
        /* --- end HACK: PREVENT LEFT PULL ON SLIDEBOX --- */

        ) {
      return;
    }