Skip to content

Commit

Permalink
TypeaheadSearch: Remove active class
Browse files Browse the repository at this point in the history
This class is no longer needed within the component, and its
only use was in an application (Vector search app) that has
already been updated in I738c0f24dcd to handle the active
state within the application code.

Bug: T316893
Change-Id: I81ac37b5f789f44afdf660d82fa1748699eb6726
  • Loading branch information
AnneTee authored and Volker-E committed Sep 7, 2022
1 parent 053656e commit c1222ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ describe( 'TypeaheadSearch initial state', () => {

const input = wrapper.find( '.cdx-text-input__input' );
await input.trigger( 'focus' );
expect( wrapper.find( '.cdx-typeahead-search' ).classes() ).toContain( 'cdx-typeahead-search--active' );
expect( wrapper.find( '.cdx-typeahead-search' ).classes() ).not.toContain( 'cdx-typeahead-search--expanded' );
expect( wrapper.vm.expanded ).toBeFalsy();
} );
Expand All @@ -112,7 +111,6 @@ describe( 'TypeaheadSearch initial state', () => {
expect( wrapper.vm.expanded ).toStrictEqual( true );

await input.trigger( 'blur' );
expect( wrapper.find( '.cdx-typeahead-search' ).classes() ).not.toContain( 'cdx-typeahead-search--active' );
expect( wrapper.find( '.cdx-typeahead-search' ).classes() ).not.toContain( 'cdx-typeahead-search--expanded' );
expect( wrapper.vm.expanded ).toBeFalsy();
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ export default defineComponent( {
// delay, to avoid momentarily showing them to users with fast connections.
const showPending = ref( false );
// Whether the TypeaheadSearch is being used; used for applying conditional styles.
// Whether the TypeaheadSearch input is focused.
// TODO: consider changing this variable and the one in Lookup to `isFocused` for clarity.
const isActive = ref( false );
// Current text input value; initially set to the initialInputValue prop.
Expand Down Expand Up @@ -320,8 +321,6 @@ export default defineComponent( {
// Get helpers from useSplitAttributes.
const internalClasses = computed( () => {
return {
// TODO: remove this class once T316893 is complete in Vector.
'cdx-typeahead-search--active': isActive.value,
'cdx-typeahead-search--show-thumbnail': props.showThumbnail,
'cdx-typeahead-search--expanded': expanded.value,
'cdx-typeahead-search--auto-expand-width': props.showThumbnail && props.autoExpandWidth
Expand Down

0 comments on commit c1222ce

Please sign in to comment.