Skip to content

Commit

Permalink
Merge pull request #16518 from Nexus-Mods/fblo-mutable-index
Browse files Browse the repository at this point in the history
fblo: fixed index not resetting when de-selecting
  • Loading branch information
insomnious authored Oct 7, 2024
2 parents 33ed5a0 + 03d66f1 commit b3c2a81
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion src/controls/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion src/extensions/file_based_loadorder/views/loadOrderIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -59,9 +64,9 @@ export function LoadOrderIndexInput(props: IProps) {
value={inputValue}
onChange={handleInputChange}
onKeyDown={handleKeyPress}
onBlur={handleBlur}
min={startIndex}
max={maxIndex}
defaultValue={currentPosition}
/>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12153,9 +12153,9 @@ [email protected]:
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"
Expand Down

0 comments on commit b3c2a81

Please sign in to comment.