From 8b9d405eff3582fc4624346783074229ce8cc7a0 Mon Sep 17 00:00:00 2001 From: IDCs Date: Thu, 3 Oct 2024 12:22:41 +0100 Subject: [PATCH 1/4] fblo: fixed index not resetting when de-selecting also removed redundant "defaultValue" as this is an interactive component --- .../file_based_loadorder/views/loadOrderIndex.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extensions/file_based_loadorder/views/loadOrderIndex.tsx b/src/extensions/file_based_loadorder/views/loadOrderIndex.tsx index d41212cd0..224c04016 100644 --- a/src/extensions/file_based_loadorder/views/loadOrderIndex.tsx +++ b/src/extensions/file_based_loadorder/views/loadOrderIndex.tsx @@ -46,6 +46,11 @@ export function LoadOrderIndexInput(props: IProps) { } }, [currentPosition, maxIndex, startIndex, inputValue]); + const handleBlur = React.useCallback(() => { + // User moved away from the input, reset the index. + setInputValue(currentPosition.toString()); + }, [currentPosition]); + React.useEffect(() => { setInputValue(currentPosition.toString()); }, [currentPosition]); @@ -59,9 +64,9 @@ export function LoadOrderIndexInput(props: IProps) { value={inputValue} onChange={handleInputChange} onKeyDown={handleKeyPress} + onBlur={handleBlur} min={startIndex} max={maxIndex} - defaultValue={currentPosition} /> ); From 35ac9319d4d8857fe904a1a3d96ced2e0da787e3 Mon Sep 17 00:00:00 2001 From: IDCs Date: Mon, 7 Oct 2024 07:35:08 +0100 Subject: [PATCH 2/4] Exporting LoadOrderIndexInput component This will allow community extensions that define a custom item renderer component to use the LO index input box to change the order of the rendered items --- src/controls/api.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controls/api.ts b/src/controls/api.ts index b7e4a586c..63087b078 100644 --- a/src/controls/api.ts +++ b/src/controls/api.ts @@ -43,11 +43,13 @@ import VisibilityProxy from './VisibilityProxy'; import Webview from './Webview'; import ZoomableImage from './ZoomableImage'; +import { LoadOrderIndexInput } from '../extensions/file_based_loadorder/views/loadOrderIndex'; + export { ActionContextMenu, ActionDropdown, Advanced, Banner, ChangeDataHandler, ContextMenu, Dashlet, DraggableList, Dropdown, DropdownButton, Dropzone, EmptyPlaceholder, ErrorBoundary, FlexLayout, FormFeedback, FormInput, FormCheckboxItem, FormPathItem, FormTextItem, Icon, IconBar, - Image, ITableRowAction, makeGetSelection, Modal, + Image, ITableRowAction, LoadOrderIndexInput, makeGetSelection, Modal, More, OptionsFilter, Overlay, OverlayTrigger, PortalMenu, ProgressBar, RadialProgress, SelectUpDown, Spinner, Steps, Table, TableDateTimeFilter, TableNumericFilter, TableTextFilter, Timer, TriStateCheckbox, From f8f8c2d84ad14d850059787d490ac3a21c24a1d9 Mon Sep 17 00:00:00 2001 From: IDCs Date: Mon, 7 Oct 2024 07:45:38 +0100 Subject: [PATCH 3/4] Use updated API --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 199a62e47..c61bbde82 100644 --- a/package.json +++ b/package.json @@ -197,7 +197,7 @@ "tslint-eslint-rules": "^5.4.0", "tslint-react": "^4.1.0", "typescript": "^4.4.3", - "vortex-api": "Nexus-Mods/vortex-api", + "vortex-api": "Nexus-Mods/vortex-api#fblo_api_update_1.8.11", "webpack": "^5.76.0", "webpack-cli": "^4.8.0", "webpack-node-externals": "^3.0.0" From 03d66f18cdf841d84bad49309dab826d06247623 Mon Sep 17 00:00:00 2001 From: IDCs Date: Mon, 7 Oct 2024 08:41:18 +0100 Subject: [PATCH 4/4] updating dependencies --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d3e69a1f6..143da7e98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12153,9 +12153,9 @@ void-elements@3.1.0: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-3.1.0.tgz#614f7fbf8d801f0bb5f0661f5b2f5785750e4f09" integrity sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w== -vortex-api@Nexus-Mods/vortex-api: - version "1.8.7" - resolved "https://codeload.github.com/Nexus-Mods/vortex-api/tar.gz/1c8f56d4c5e05e77ad90e822fdd58f3f33c1c4f3" +vortex-api@Nexus-Mods/vortex-api#fblo_api_update_1.8.11: + version "1.8.11" + resolved "https://codeload.github.com/Nexus-Mods/vortex-api/tar.gz/9d51cfafea5f96eb6eca2be4371e32b236f77891" vortex-parse-ini@Nexus-Mods/vortex-parse-ini: version "0.3.0"