Skip to content

Commit

Permalink
ensure ready
Browse files Browse the repository at this point in the history
  • Loading branch information
moritztim committed Jan 22, 2024
1 parent 3aa0bbb commit 3b265c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/form/nodes/FormLabel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ func _enter_tree():
if !visibility_changed.is_connected(update_display_mode):
visibility_changed.connect(update_display_mode)

func _ready():
indicate_required()

## Update label display mode based on visibility
## If the label is visible and the mode is either Mode.IN_INPUT or Mode.HIDDEN, the mode is set to Mode.SEPARATE.
## If the label is not visible and the mode is Mode.SEPARATE, the mode is set to Mode.HIDDEN.
Expand All @@ -99,6 +102,8 @@ func update_display_mode():

## Add or remove the required_hint if input_required
func indicate_required():
if !is_node_ready():
return
# if * needed but not present
if input_required:
if required_hint not in ["", null]&&!text.ends_with(required_hint):
Expand Down

0 comments on commit 3b265c6

Please # to comment.