From faf767179936b3f1227af6452c67b4150f17e118 Mon Sep 17 00:00:00 2001 From: boatbomber Date: Mon, 8 Aug 2022 00:58:32 -0700 Subject: [PATCH] Make error messages copyable (#614) * Make error copyable * Allow partial copying or double click full copy --- plugin/src/App/StatusPages/Error.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugin/src/App/StatusPages/Error.lua b/plugin/src/App/StatusPages/Error.lua index 15fe5446..8af669c6 100644 --- a/plugin/src/App/StatusPages/Error.lua +++ b/plugin/src/App/StatusPages/Error.lua @@ -57,8 +57,16 @@ function Error:render() end, }, { ErrorMessage = Theme.with(function(theme) - return e("TextLabel", { + return e("TextBox", { + [Roact.Event.InputBegan] = function(rbx, input) + if input.UserInputType ~= Enum.UserInputType.MouseButton1 then return end + rbx.SelectionStart = 0 + rbx.CursorPosition = #rbx.Text+1 + end, + + Text = self.props.errorMessage, + TextEditable = false, Font = Enum.Font.Code, TextSize = 16, TextColor3 = theme.ErrorColor, @@ -66,10 +74,9 @@ function Error:render() TextYAlignment = Enum.TextYAlignment.Top, TextTransparency = self.props.transparency, TextWrapped = true, - - Size = UDim2.new(1, 0, 1, 0), - + ClearTextOnFocus = false, BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), }) end),