Refactor MarketTypeInput to use the shared SelectInput component #22

Open
opened 2026-07-09 19:18:54 +02:00 by Sirttas · 0 comments
Owner

Summary

MarketTypeInput (src/market/type/MarketTypeInput.vue) hand-rolls its own autocomplete dropdown — useVirtualList, moveUp/moveDown, currentIndex highlight, click-outside, enter-to-select. That behavior is now encapsulated in the shared generic SelectInput<T> (src/components/SelectInput.vue), already used by MarketLocationInput.

Proposed change

  • Rebuild MarketTypeInput on top of SelectInput, using its input and item slots.
  • Drive suggestions from searchMarketTypes (debounced), same as MarketLocationInput drives searchMarketLocations.
  • Drop the duplicated keyboard-nav / virtual-list / click-outside code.

Acceptance criteria

  • MarketTypeInput renders via SelectInput.
  • Arrow up/down, Enter-to-select, click-outside and the type icon still work.
  • npm run build passes.

Related

Pairs with the "fix item select not working" issue (the suggestions.length > 1 bug), and the ledger-input refactor.

## Summary `MarketTypeInput` (`src/market/type/MarketTypeInput.vue`) hand-rolls its own autocomplete dropdown — `useVirtualList`, `moveUp`/`moveDown`, `currentIndex` highlight, click-outside, enter-to-select. That behavior is now encapsulated in the shared generic `SelectInput<T>` (`src/components/SelectInput.vue`), already used by `MarketLocationInput`. ## Proposed change - Rebuild `MarketTypeInput` on top of `SelectInput`, using its `input` and `item` slots. - Drive suggestions from `searchMarketTypes` (debounced), same as `MarketLocationInput` drives `searchMarketLocations`. - Drop the duplicated keyboard-nav / virtual-list / click-outside code. ## Acceptance criteria - [ ] `MarketTypeInput` renders via `SelectInput`. - [ ] Arrow up/down, Enter-to-select, click-outside and the type icon still work. - [ ] `npm run build` passes. ## Related Pairs with the "fix item select not working" issue (the `suggestions.length > 1` bug), and the ledger-input refactor.
Sirttas added the
Status
To Refine
label 2026-07-09 19:30:20 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eveal/gemory#22