Focus passthrough

is there a way to make a label focus passthrough ?

I have a draggable component with a label for “title”, but when I want to drag the component clicking on the title, the title grabs the focus off of the component even though the label has no listener added.

This should do the trick, myLabel.setInterceptsMouseClicks (false, false);

1 Like

amazing, thanks a lot !

weirdly, it works only when the label is the only child of a component OR if the label is overlapped by another child component that has a listener , I tried (false, true) too, with no success either.

I think there are more relevant details to your design that are not apparent from your post. All of the basic pieces work flawlessly, you just need to figure out how you are using them incorrectly? :slight_smile:

1 Like

yeah, I tried with a simplified version of my component, and it works flawlessly. Thanks for the pointers!

1 Like

You may also have a look at Component::setWantsKeyboardFocus() and Component::setMouseClickGrabsKeyboardFocus()