Clearing a textbox with "" doesn't fully clear it?

Nevermind. It wouldn’t work.
Anyway, try placing an invisible part inside of lighting, and name it “”. Use it’s name instead of “”

I’ll try swapping the sequence so it captures focus after changing to an empty string
I’ll update this post if it worked

(This infact, did not work)

1 Like

It will remain the same if CaptureFocus() add a blank when called.

1 Like

That would just make the string ‘“”’
and I don’t think it’s possible to name a part an empty string

1 Like

The main problem is that CaptureFocus() adds a space as the first character, but setting the text to “” does not remove this first space as there is no text. Therefore, you need to use a workaround with a text label instead or consider not using CaptureFocus() at all.

1 Like

Imma be honest, I probably wont find a solution to this, I’ll have to use some weird workaround.

1 Like

It’s probably inserting a carriage return "\r" or "\13" when you’re pressing the Enter.

Put a task.wait() before the CaptureFocus.

textbox.FocusLost:Connect(function(enterp: bool)
	if not enterp then
		return
	end

	task.wait()
	textbox:CaptureFocus()
	textbox.Text = ""
end)

Also I did some testing and both the PlaceholderText and the cursor will appear.
existing question

1 Like

tostring(nil) returns “nil”

characters

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.