hide context menu for ColorPicker

Godot Version

Godot v4.3 stable

Question

Hey there,
I am currently working on a project and would like to disable the context menu for a ColorPicker node. I’ve tried finding an option in the inspector and tried to get it working through code as you can do it with normal LineEdits but didn’t manage to do it.

I am specifically talking about the menu that opens when right-clicking on a LineEdit (those where you can put in your own Hex-Code / RGB(A)-values).

Is there any way to disable it?

Thanks in advance. :slight_smile:

Find the LineEdit node with Node.find_children() like: color_picker.find_children("*", "LineEdit", true, false) and set its LineEdit.context_menu_enabled to false

Thanks! Works perfectly fine now, thank you.
Only a brief addition if someone needs it one day: if you have an “issue” with the LineEdit’s content resetting when right-clicking in it now, try this complete code, I added the thingy with “event”:

var line_edits = $ColorPicker.find_children("*", "LineEdit", true, false)
for c in line_edits: # c for children, idk if that is correct but yk what i mean
	c.context_menu_enabled = false
		

c.gui_input.connect(func(event):
	if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_RIGHT:
		c.accept_event()
	)