splitpanes icon indicating copy to clipboard operation
splitpanes copied to clipboard

Emit double click event

Open giuppep opened this issue 2 years ago • 2 comments

Currently it's possible to maximise the panel after a splitter by double clicking on it. However, this is not necessarily the behaviour one would generally expect.

For example, I'd like to be able to reset the initial size of the panes when double clicking on the splitter. As another example, one may want to maximise the pane before the splitter - as already mentioned in the docs:

You can also double click a splitter to maximize the next pane! (First pane splitter will be an option soon)

Other users may want to implement other custom behaviour, see e.g. #181.

These issues could all be solved by simply emitting the double-click event and let the user handle it how they like.

giuppep avatar Jan 12 '23 13:01 giuppep

I have this need too. Can't use this lib until it's finally handled 😢

M1CK431 avatar Mar 15 '23 10:03 M1CK431

Try this:

  let splitterClickCount = 0 
  
  const onSplitterClick = () => {
    splitterClickCount += 1
    if (splitterClickCount === 2) {
      doStuffOnDblClick()
      splitterClickCount = 0 
    }
  }

mariusvigariu avatar Jul 21 '23 08:07 mariusvigariu