How could I stop item to be removed when onSwipeoutDelete event fired?


#1

I’m using F7-React

onSwipeoutDelete = (event) => {
    showDeveloping()
    // TODO can't stop it...
    event.cancelBubble = true
    event.stopPropagation()
    return false;
  }

#2

At the moment you can only disable it by passing swipeout.removeElements: false to app parameters to handle it manually http://framework7.io/docs/swipeout.html#swipeout-app-parameters


#3
const f7params = {
      id: 'io.framework7.testapp', // App bundle ID
      name: 'Framework7', // App name
      theme: 'ios', //'auto', // Automatic theme detection
      language: 'zh-CN',
      dialog: {
        // set default title for all dialog shortcuts
        title: '提示',
        // change default "OK" button text
        buttonOk: '确定',
        buttonCancel: '取消',
      },
      swipeout: {
        removeElements: false,
        removeElementsWithTimeout: true,
        removeElementsTimeout: 1000
      },
      // App routes
      routes,
    };

Why all the swipeout params not work totally, however the dialog params works fine?
Thanks very much.

"framework7": "^3.0.1",
"framework7-react": "^3.0.1",

#4

Would be good to see example where it doesn’t work. Just checked, all works


#5

Worked when I add confirmText prop
<SwipeoutButton delete confirmText={sure?}>del</SwipeoutButton>