From 5502b7c88662b3ab19d76834699890613d399b3b Mon Sep 17 00:00:00 2001 From: Nicolas Echezarreta Date: Tue, 12 Nov 2024 05:39:28 -0800 Subject: [PATCH] add auto-select to TextField component (#1034) --- .../ActionInspector/ActionInspector.tsx | 4 ++++ .../CloneEntityAction/CloneEntityAction.tsx | 3 +++ .../FollowPlayerAction/FollowPlayerAction.tsx | 2 ++ .../MovePlayerAction/MovePlayerAction.tsx | 3 +++ .../OpenLinkAction/OpenLinkAction.tsx | 1 + .../PlayAudioStreamAction.tsx | 2 +- .../PlayVideoStreamAction.tsx | 2 +- .../SetPositionAction/SetPositionAction.tsx | 3 +++ .../SetRotationAction/SetRotationAction.tsx | 3 +++ .../SetScaleAction/SetScaleAction.tsx | 3 +++ .../ShowImageAction/ShowImageAction.tsx | 6 +++--- .../ShowTextAction/ShowTextAction.tsx | 4 ++-- .../TeleportPlayerAction.tsx | 2 ++ .../TriggerProximityAction.tsx | 2 ++ .../TweenAction/TweenAction.tsx | 3 +++ .../AnimatorInspector/AnimatorInspector.tsx | 2 +- .../AudioStreamInspector.tsx | 2 +- .../CounterBarInspector.tsx | 2 +- .../CounterInspector/CounterInspector.tsx | 2 +- .../MeshColliderInspector.tsx | 4 ++-- .../MeshRendererInspector.tsx | 4 ++-- .../NftShapeInspector/NftShapeInspector.tsx | 2 ++ .../PointerEventsInspector.tsx | 1 + .../Layout/ModeAdvanced/ModeAdvanced.tsx | 4 ++-- .../SceneInspector/SceneInspector.tsx | 13 ++++++++++--- .../ActionView/ActionView.tsx | 1 + .../CounterBarView/CounterBarView.tsx | 1 + .../SmartItemBasicView/NftView/NftView.tsx | 2 ++ .../PointerEventView/PointerEventView.tsx | 1 + .../SmartItemBasicView/VideoView/VideoView.tsx | 2 +- .../StatesInspector/StatesInspector.tsx | 1 + .../TextShapeInspector/TextShapeInspector.tsx | 14 +++++++------- .../TransformInspector/TransformInspector.tsx | 18 +++++++++--------- .../TriggerCondition/TriggerCondition.tsx | 2 ++ .../TweenInspector/TweenInspector.tsx | 12 ++++++------ .../VideoPlayerInspector.tsx | 2 +- .../src/components/ImportAsset/ImportAsset.tsx | 2 +- .../ui/Dropdown/OptionList/OptionList.tsx | 1 + .../ui/FileUploadField/FileUploadField.tsx | 1 + .../src/components/ui/TextField/TextField.tsx | 2 ++ .../src/components/ui/TextField/types.ts | 1 + .../components/ui/WalletField/WalletField.tsx | 1 + 42 files changed, 98 insertions(+), 45 deletions(-) diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ActionInspector.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ActionInspector.tsx index 591934a5d..94435721d 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ActionInspector.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ActionInspector.tsx @@ -673,6 +673,7 @@ export default withSdk(({ sdk, entity: entityId }) => { type="number" value={getPartialPayload(action)?.counter} onChange={(e: React.ChangeEvent) => handleChangeCounter(e, idx)} + autoSelect /> @@ -687,6 +688,7 @@ export default withSdk(({ sdk, entity: entityId }) => { type="number" value={getPartialPayload(action)?.amount} onChange={(e: React.ChangeEvent) => handleChangeAmount(e, idx)} + autoSelect /> @@ -701,6 +703,7 @@ export default withSdk(({ sdk, entity: entityId }) => { type="number" value={getPartialPayload(action)?.amount} onChange={(e: React.ChangeEvent) => handleChangeAmount(e, idx)} + autoSelect /> @@ -958,6 +961,7 @@ export default withSdk(({ sdk, entity: entityId }) => { onChange={(e) => handleChangeName(e, idx)} onFocus={handleFocusInput} onBlur={handleFocusInput} + autoSelect /> = ({ value, onUpdate }: Props) => { type="number" value={payload.position?.x} onChange={(e: React.ChangeEvent) => handleChangePositionX(e)} + autoSelect /> ) => handleChangePositionY(e)} + autoSelect /> ) => handleChangePositionZ(e)} + autoSelect /> diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/FollowPlayerAction/FollowPlayerAction.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/FollowPlayerAction/FollowPlayerAction.tsx index 576d172fa..f0589a341 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/FollowPlayerAction/FollowPlayerAction.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/FollowPlayerAction/FollowPlayerAction.tsx @@ -83,12 +83,14 @@ const FollowPlayerAction: React.FC = ({ value, onUpdate }: Props) => { type="text" value={payload.speed} onChange={(e: React.ChangeEvent) => handleChangeSpeed(e)} + autoSelect /> ) => handleChangeMinDistance(e)} + autoSelect /> diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/MovePlayerAction/MovePlayerAction.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/MovePlayerAction/MovePlayerAction.tsx index 68317c809..c36e0276d 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/MovePlayerAction/MovePlayerAction.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/MovePlayerAction/MovePlayerAction.tsx @@ -91,18 +91,21 @@ const MovePlayerAction: React.FC = ({ value, onUpdate }: Props) => { type="number" value={payload.position?.x} onChange={(e: React.ChangeEvent) => handleChangePositionX(e)} + autoSelect /> ) => handleChangePositionY(e)} + autoSelect /> ) => handleChangePositionZ(e)} + autoSelect /> diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/OpenLinkAction/OpenLinkAction.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/OpenLinkAction/OpenLinkAction.tsx index b4969333f..209e796c7 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/OpenLinkAction/OpenLinkAction.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/OpenLinkAction/OpenLinkAction.tsx @@ -39,6 +39,7 @@ const OpenLinkAction: React.FC = ({ value, onUpdate }: Props) => { label="URL" value={payload.url} onChange={(e: React.ChangeEvent) => handleChangeEmote(e)} + autoSelect /> diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/PlayAudioStreamAction/PlayAudioStreamAction.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/PlayAudioStreamAction/PlayAudioStreamAction.tsx index ee7f58908..a4576a47c 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/PlayAudioStreamAction/PlayAudioStreamAction.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/PlayAudioStreamAction/PlayAudioStreamAction.tsx @@ -41,7 +41,7 @@ const PlayAudioStreamAction: React.FC = ({ value, onUpdate }: Props) => { return (
- + = ({ value, onUpdate }: Props) => { {!payload.dclCast ? ( <> - URL {renderUrlInfo()}} value={payload.src} onChange={handleChangeSrc} /> + URL {renderUrlInfo()}} value={payload.src} onChange={handleChangeSrc} autoSelect /> = ({ value, onUpdate }: Props) => { type="number" value={payload.x} onChange={(e: React.ChangeEvent) => handleChangeX(e)} + autoSelect /> ) => handleChangeY(e)} + autoSelect /> ) => handleChangeZ(e)} + autoSelect />
diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetRotationAction/SetRotationAction.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetRotationAction/SetRotationAction.tsx index 497e5d0e0..ba6eb8232 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetRotationAction/SetRotationAction.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetRotationAction/SetRotationAction.tsx @@ -73,18 +73,21 @@ const SetRotationAction: React.FC = ({ value, onUpdate }: Props) => { type="number" value={payload.x} onChange={(e: React.ChangeEvent) => handleChangeX(e)} + autoSelect /> ) => handleChangeY(e)} + autoSelect /> ) => handleChangeZ(e)} + autoSelect />
diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetScaleAction/SetScaleAction.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetScaleAction/SetScaleAction.tsx index e0883ae02..0055bb2f0 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetScaleAction/SetScaleAction.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/SetScaleAction/SetScaleAction.tsx @@ -73,18 +73,21 @@ const SetScaleAction: React.FC = ({ value, onUpdate }: Props) => { type="number" value={payload.x} onChange={(e: React.ChangeEvent) => handleChangeX(e)} + autoSelect /> ) => handleChangeY(e)} + autoSelect /> ) => handleChangeZ(e)} + autoSelect /> diff --git a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ShowImageAction/ShowImageAction.tsx b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ShowImageAction/ShowImageAction.tsx index 6853c2522..09278c4f6 100644 --- a/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ShowImageAction/ShowImageAction.tsx +++ b/packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ShowImageAction/ShowImageAction.tsx @@ -101,8 +101,8 @@ const ShowImageAction: React.FC = ({ value, onUpdate }: Props) => { /> - - + + = ({ value, onUpdate }: Props) => {