Prevent NodeView Selection on Click?

Is it possible to prevent a NodeView from being selected when clicked? Or, better yet, have the outer view receive click events, to determine manually whether or not the NodeView should be selected?

For instance, can the footnote example be modified so that the footnote appears ONLY when the user “arrows into” the NodeView, but not on click events?

Context: I’m implementing a NodeView to assist with wysiwyg-style Markdown links. They appear as normal links until the user clicks / arrows into them, at which point they become like [link][http://example.com] so the user can edit the source. However, when the user presses CTRL, I want to open the link. Ideally I shouldn’t need to pass an link-opening logic to the NodeView itself – when the NodeView is clicked with CTRL pressed, I want the outer NodeView to handle the click event instead of expanding the NodeView.

Failed Attempt #1

I’ve tried letting some events bubble up from the NodeView like so, but it doesn’t seem to help the outer view react to the NodeView being clicked:

stopEvent(event: Event): boolean {
	if(event instanceof MouseEvent && event.ctrlKey){
		return false;
	}
	return (this._innerView !== undefined)
		&& (event.target !== undefined)
		&& this._innerView.dom.contains(event.target as Node);
}

Thanks in advance for your help!

You can register a handleClickOn prop with your logic. That should fire before the built-in selection logic (and will prevent that from running when it returns true).

This solution worked, thanks!