Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Autocomplete dropdown width calculates on search #2

Merged
merged 6 commits into from
Nov 12, 2018

Conversation

Blackbaud-AlexKingman
Copy link
Contributor

@Blackbaud-AlexKingman Blackbaud-AlexKingman commented Oct 12, 2018

@codecov-io
Copy link

codecov-io commented Oct 12, 2018

Codecov Report

Merging #2 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #2   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          13     13           
  Lines         612    613    +1     
  Branches      107    107           
=====================================
+ Hits          612    613    +1
Impacted Files Coverage Δ
...lic/modules/autocomplete/autocomplete.component.ts 100% <100%> (ø) ⬆️
...dules/autocomplete/autocomplete-adapter.service.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d3427b...92b0c1a. Read the comment docs.

Copy link
Contributor

@blackbaud-conorwright blackbaud-conorwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

});
merge(
Observable.fromEvent(this.windowRef.getWindow(), 'resize'),
Observable.fromEvent(elementRef.nativeElement.querySelector('input[skyAutocomplete], textarea[skyAutocomplete]'), 'focus')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this from the context of the autocomplete component, resizing the dropdown when the input is focused seems odd ("Why do I need to resize the dropdown when the input is focused?"). I know it works for the specific use case in the vertical tabs/modal component, but is there a way to repaint the dropdown that's more obvious from the autocomplete's perspective?

Is the issue related to how vertical tabs paints its hidden panels?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dropdown only gets redrawn once on ViewInit, and then any time a window is resized, or a user focuses on the input. After conversation, we've decided to call redraw every time a search is made. Change incoming.

@Blackbaud-SteveBrush
Copy link
Member

@Blackbaud-AlexKingman Also, whichever strategy you decide to go with will need a unit test.

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit 6089a9e into master Nov 12, 2018
@Blackbaud-SteveBrush Blackbaud-SteveBrush deleted the 2029-autocomplete-in-modal-fix branch November 12, 2018 17:17
@Blackbaud-AlexKingman Blackbaud-AlexKingman changed the title Autocomplete size/position now calculates on focus Autocomplete dropdown width calculates on search Nov 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants