React9k / react-timeline-9000

React Timeline
http://react-timeline-9000.s3-website-ap-southeast-2.amazonaws.com/
MIT License
284 stars 36 forks source link

Add new prop interactOptions #213

Closed marklawlor closed 3 years ago

marklawlor commented 3 years ago

Proposed Change:

Add the new prop interactOptions which allows customisation of interactjs

This prop is an object with 3 possible keys,

pointerEvents: Allow setting custom interactjs.pointEvents options draggable: Allow setting custom interactjs.draggable options resizable: Allow setting custom interactjs.resizable options

Example usage

const interactOptions = {
  pointerEvents: {
    ignoreFrom: '[no-pointer-event]', // Prevent the item selected callbacks when clicking on these elements
  },
  resizable: {
    cursorChecker (action) { // Use custom cursors
      if (action.edges.left) { return 'w-resize'}
      if (action.edges.right) { return 'e-resize'}
    }
  }
}

<Timeline {...props} interactOptions={interactOptions}/>

Change type

Checklist