Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Conversation

bmdalex
Copy link
Collaborator

@bmdalex bmdalex commented May 6, 2019

feat(dropdown): align, position, offset props + automatic position

This PR tackles:

  • introducing align, position, offset props for Dropdown component
  • automatic positioning for Dropdown results
  • reuses code from fix(Popup): avoid double rendering #1153 to avoid double render and simplify code

TODO:

  • Refactor method names and clean code
  • Extract common code for positioning elements to src/lib/positioner
  • Integrate new Positioner helper component to Popup and Dropdown
  • Refactor unit tests for positionerHelper (move from Popup-test.tsx to dedicated file)
  • Figure out way how to add some extra padding between Dropdown trigger and list of results
    any ideas?

@bmdalex bmdalex self-assigned this May 6, 2019
@bmdalex bmdalex force-pushed the feat/dropdown-positioning branch 2 times, most recently from 351106c to fd387e2 Compare May 7, 2019 09:24
@bmdalex bmdalex force-pushed the feat/dropdown-positioning branch 3 times, most recently from b21926a to 4961112 Compare May 9, 2019 17:45
@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #1294 into master will increase coverage by 0.03%.
The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1294      +/-   ##
==========================================
+ Coverage   72.17%   72.21%   +0.03%     
==========================================
  Files         753      756       +3     
  Lines        5621     5629       +8     
  Branches     1671     1648      -23     
==========================================
+ Hits         4057     4065       +8     
  Misses       1557     1557              
  Partials        7        7
Impacted Files Coverage Δ
...themes/teams/components/Dropdown/dropdownStyles.ts 19.23% <ø> (ø) ⬆️
packages/react/src/index.ts 100% <ø> (ø) ⬆️
packages/react-component-ref/src/Ref.tsx 100% <ø> (ø) ⬆️
...ackages/react/src/components/Dropdown/Dropdown.tsx 87.89% <100%> (+0.14%) ⬆️
...ages/react/src/lib/positioner/positioningHelper.ts 100% <100%> (ø)
...t/src/lib/positioner/createPopperReferenceProxy.ts 40% <100%> (ø)
...es/react/src/lib/positioner/UpdatableComponent.tsx 100% <100%> (ø)
packages/react/src/lib/positioner/index.ts 100% <100%> (ø)
packages/react/src/components/Popup/Popup.tsx 67.51% <100%> (-0.78%) ⬇️
packages/react/src/lib/positioner/Positioner.tsx 80% <80%> (ø)
... and 3 more

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 1bf39a4...614669d. Read the comment docs.

@DustyTheBot
Copy link
Collaborator

Warnings
⚠️ There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.

Generated by 🚫 dangerJS

@bmdalex bmdalex force-pushed the feat/dropdown-positioning branch 2 times, most recently from 91e5fec to 8770717 Compare May 9, 2019 18:01
* Popup experiment

* cleanup

* more cleanups

* rename file

* add changelog entries

* add "implements PopperJS.ReferenceObject"

* replace `triggerDomElement` with `triggerRef.current`

* update typings

* rewrite to WeakMap

* update comment

* remove memoization
@bmdalex bmdalex force-pushed the feat/dropdown-positioning branch from 8770717 to 614669d Compare May 9, 2019 18:04
@bmdalex bmdalex closed this May 9, 2019
@bmdalex bmdalex deleted the feat/dropdown-positioning branch May 9, 2019 18:35
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.

3 participants