From c9e979ff39fd7c2affed9d8ace42bcf1d8d968dc Mon Sep 17 00:00:00 2001 From: boatbomber Date: Sat, 6 Aug 2022 14:33:02 -0700 Subject: [PATCH 1/2] Make error copyable --- plugin/src/App/StatusPages/Error.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugin/src/App/StatusPages/Error.lua b/plugin/src/App/StatusPages/Error.lua index 15fe5446e..e5b029847 100644 --- a/plugin/src/App/StatusPages/Error.lua +++ b/plugin/src/App/StatusPages/Error.lua @@ -57,8 +57,9 @@ function Error:render() end, }, { ErrorMessage = Theme.with(function(theme) - return e("TextLabel", { + return e("TextBox", { Text = self.props.errorMessage, + TextEditable = false, Font = Enum.Font.Code, TextSize = 16, TextColor3 = theme.ErrorColor, @@ -66,10 +67,14 @@ 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), + [Roact.Change.CursorPosition] = function(rbx) + if rbx.CursorPosition == -1 then return end + rbx.SelectionStart = 0 + rbx.CursorPosition = #rbx.Text+1 + end, }) end), From 78a89ce17039f9b245cd20b2444a4938fadd7bde Mon Sep 17 00:00:00 2001 From: boatbomber Date: Sat, 6 Aug 2022 17:13:44 -0700 Subject: [PATCH 2/2] Allow partial copying or double click full copy --- plugin/src/App/StatusPages/Error.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugin/src/App/StatusPages/Error.lua b/plugin/src/App/StatusPages/Error.lua index e5b029847..8af669c60 100644 --- a/plugin/src/App/StatusPages/Error.lua +++ b/plugin/src/App/StatusPages/Error.lua @@ -58,6 +58,13 @@ function Error:render() }, { ErrorMessage = Theme.with(function(theme) 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, @@ -70,11 +77,6 @@ function Error:render() ClearTextOnFocus = false, BackgroundTransparency = 1, Size = UDim2.new(1, 0, 1, 0), - [Roact.Change.CursorPosition] = function(rbx) - if rbx.CursorPosition == -1 then return end - rbx.SelectionStart = 0 - rbx.CursorPosition = #rbx.Text+1 - end, }) end),