Skip to content

Commit

Permalink
tests: fix c-select test
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Dec 4, 2024
1 parent 8bf9ffe commit bffd69c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ describe("CSelect", () => {
await mainInput.trigger("keydown.esc");
expect(wrapper.vm.menuOpen).toBeFalsy();

await delay(400);

// Open it again
await mainInput.trigger("keydown.space");
expect(wrapper.vm.menuOpen).toBeTruthy();
Expand Down
13 changes: 13 additions & 0 deletions src/coalesce-vue-vuetify3/src/components/input/c-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,19 @@ import {
} from "coalesce-vue";
import { VField, VInput } from "vuetify/components";
/* DEV NOTES:
* - Experimented with moving this back to be based on v-autocomplete on 2024 Nov 22. Found issues:
* - When the menu opens, a janky scroll to the selected item occurs,
* with pre-scroll content flashing into view for a few frames.
* - Scroll of the list doesn't reset when searching, no easy way to do this manually
* - Arrow key navigation relies on tab focus, which fundamentally doesn't work with virtual scrolling.
* Specifically, hitting "UpArrow" when the top item is selected wraps around to the bottom of the list,
* but the bottom of the rendered list is really only somewhere in the middle of the true list.
* - Menu isn't animated when it opens for some reason
* - Have to use direct DOM manipulation to intercept focus events on the search input inside the v-autocomplete.
* Very hard to get this to behave consistently.
*/
defineOptions({
name: "c-select",
// We manually pass attrs via inputBindAttrs, so disable the default Vue behavior.
Expand Down

0 comments on commit bffd69c

Please sign in to comment.