When using a multi-line, top left aligned TextBox, tabs appear as spaces. Printing out the ASCII bytes associated with the Text property reveals that TextBoxes are accepting tabs (ASCII byte 9), but the TextBox is displaying it as a space (ASCII character 32).
I’m running Studio on Windows 10 in VMWorkstation on Debian 11 (Sid). This place with a simple ScreenGui and TextBox inside of the StartGui causes the issue for me: TextboxBugRepo.rbxl (14.4 KB)
I’m currently trying to make a multi-line text editor widget in Studio and ran into a couple problems when trying to use a Multi-line TextBox. I’ve submitted another bug report and feature request related to this project here:
This is still the case, and is extremely annoying.
I’ve been working on using a TextBox for an IDE, and I have to gsub “\t” to 4 spaces for it to show up properly, but then users have to backspace 4 times and such.
I’m currently using a custom TextBox system made of many TextLabels but it’s terribly inefficient and shouldn’t be necessary.
This is still a very annoying issue that is impacting the IDE in the plugin InCommand, since we have to force users to use spaces instead of tabs because tabs still don’t work properly.
Please fix this. Tabs are either the same width as a space or even smaller than a space, depending on the font.
Bumping this 5 months later once again as the issue is still not fixed. I am working with a textbox for an IDE just like boatbomber, and the issue with tabs is very annoying.
I hate having to replace them with 4 spaces. Please fix this issue.
Hello, we have this in our backlog as a todo. There have been some other high priority bug fixes and features we have been working on for the textbox, but we also want to fix this. Thank you for the report, we appreciate it!
If anyone is looking for a simple fix for this… Here is what I came up with!
My Use Case:
– Crafting Search Bar is INSIDE my inventory (Used for Searching Recipies)
– Tab is how We Open/Close the Game Inventory … you can see why we needed a workaround haha
local TabCloseActive = false
local TabConnect = nil
local function handler(bool)
if TabConnect == nil and bool then
print("Connection Started")
TabConnect = UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Tab then
local str = SearchBar.Text
SearchBar.Text = str:sub(0, -1) -- Remove the Space that Tab Creates
SearchBar:ReleaseFocus() -- Force Focus off of TextBox (UI Focus)
InvToggle:Fire() -- Custom function to Toggle my Games Inventory
TabConnect:Disconnect() -- Disonnect from Tab CustomKeybind
TabConnect = nil -- Set Nill for Next Use
TabCloseActive = false -- Reset boolean for Next Use
end
end)
end
end
SearchBar.Changed:Connect(function(Property) -- When Property of SearchBar Changed
if Property~= "Text" then return end
if not TabCloseActive then
handler(true) -- Call the Function above to Start Listening for Keycode.Tab
TabCloseActive = true -- Save that the Bind has Been Set
end
end
I’d be Happy to answer any questions. Hopfully Roblox Fixes this SOON!
Why do you need tabs to appear as real tabs in either of these use cases?
You should be using ContextActionService or UserInputService if you just want to bind tab to an action.
Also, when posting code snippets, you should avoid sending code snippets which don’t work without lots of modification. In your snippet, InvToggle is never defined, for example. You should also try to make your code concise and easily understandable, too. I don’t understand what SearchBar is at a glance (TextBox). If there is a setup we are meant to create first before running the code, that should be explained.
Some additional feedback too:
SearchBar.Changed:Connect(function(Property) -- When Property of SearchBar Changed
if Property~= "Text" then return end
local ContextActionService = game:GetService("ContextActionService")
local function onTabAction(Name, State, Input)
if State == Enum.UserInputState.Begin then
-- do something
end
end
ContextActionService:BindAction("Tab", onTabAction, false, Enum.KeyCode.Tab)
I don’t think you understood this bug report at all…
B U M P
Still not fixed. I have a pretty big issue with this while writing an in-game script editor.
I’d have to replacce tabs with 4 spaces which would be really annoying to the users.
It has been nearly 4 years now, and this is still not fixed. It’s my first time wanting to do an IDE within Roblox studio, but it’s really annoying that the tabs aren’t changeable on size
Please roblox, fix that problem ASAP. That’ll be nice if you could. See you!
Hello - thank you all for reporting this issue! We appreciate your patience and recognize that this is a long-standing issue that is causing frustration. This issue is logged and we have recently bumped this in priority. Although we can’t provide a specific timeframe yet, we will keep this on our radar as an issue impacting the community.
This bug is fixed now, a tab will appear the same size as 4 spaces. Note that tab stop behavior is not implemented - the tab will always be exactly 4 spaces in width.
How do we make it so like, say we have an autofill system in place an the player has to click tab when they type the first word of the autofilling message in the chat and they tap tab to complete the autofill but it adds an space after that, how do you make it so it adds no space?