godotengine / godotengine/godot

SpinBox not setting the visibility layer of its inner line edit

Open
#95,352 0 comments 0 reactions 0 assignees View on GitHub
discussion enhancement topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in v4.2.1.stable.mono.official [b09f793f5]

### System information

Windows 10 - Godot v4.2.1.stable.mono.official [b09f793f5]

### Issue description

A SpinBox's `visibility_layer` does not get copied to the inner LineEdit, so changing the viewport's canvas cull mask to not have the default layer bit set hides the line edit.

I found a workaround where I attach a script to the node with the following code:
```gdscript
extends SpinBox

func _ready():
get_line_edit().visibillity_layer = visibility_layer
```

### Steps to reproduce

- Create a new SpinBox scene
- Edit the SpinBox's visibility layer to have bits 1 and 2 set
- Change the root viewport's canvas cull mask to have only bit 2 set

### Minimal reproduction project (MRP)

[spinbox-visibility-layer-bug.zip](https://github.com/user-attachments/files/16569104/spinbox-visibility-layer-bug.zip)

Starting the project and pressing the enter key toggles the root viewport's canvas cull mask between having only layer 1 and having only layer 2 visible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.