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" 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, 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} /> ); 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"