refactor(design-system): simplify OcSelect - #3524
Open
AlexAndBear wants to merge 1 commit into
Open
AlexAndBear wants to merge 1 commit into
AlexAndBear wants to merge 1 commit into
Conversation
Member
Author
|
@JammingBen i hope this gives us a little more confidence back to our beloved oc-select component :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactors
OcSelectto reduce custom code and lean on whatvue-selectalready provides. The public API (props, emits, slots) is unchanged.--vs-*CSS variables plus Tailwind@apply(~150 lines of overrides removed)!importantoverrides were unnecessary. Single-select and disabled states are now covered by vue-select's own stylesuseEventListenerfrom@vueuse/coreonBeforeUnmountoc-select-keyboard-navigationclass (set on arrow keys, cleared on mouse move)classList.addhack never removed the classes, so outlines could stick to optionspreventDefault+ typeahead)$attrsare bound after the internal defaultsmap-keydown/dropdown-should-open(used byTagsSelect,InviteCollaboratorForm,SpaceMemberSelect)console.warnfor missing option label keysRelated Issue
How Has This Been Tested?
pnpm vite) against a local OpenCloud backend, Chrome, light and dark themeOcSelectusages:5→5 GB), disabled quota select for users who never logged inpositionFixeddropdown is aligned to the toggle, scrollable and limited to the viewport heightmap-keydown)mapKeydown/dropdownShouldOpen, full unit suite passespnpm check:types, lint and format passTypes of changes