Disable mouse input on tabs in TabContainer

Godot Version

4.4.1

Question

When using TabBar if i use mousefilter Ignore, it works just as I want, the tabs do not work with mouseinput, however when I apply the same to TabContainer, it doesn’t produce that effect. I’m not sure how to get it working with TabContainer, any advice? Thank you!!

1 Like

If I am understanding correctly, you don’t want the elements inside the TabContainer’s TabBar to receive input right?

The TabContainer is a Node that displays the different tabs according to the one selected. The TabBar inside the TabContainer actually works as a normal TabBar and its a seperate child node, but it’s kinda hidden inside the TabContainer, meaning you can’t access it via the Editor Window. So, in order to change the settings of the TabBar inside the TabContainer you need to go through code.

get_tab_bar().mouse_filter = Control.MOUSE_FILTER_IGNORE

This line first retreives the TabBar inside the TabContainer and then sets its mouse filter to ignore.

You could do it like this in your TabContainer Node:

extends TabContainer

func _ready() → void:
    get_tab_bar().mouse_filter = Control.MOUSE_FILTER_IGNORE
1 Like