Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

refactor: fix alignment of menu dropdown components #1770

Merged
merged 8 commits into from
Mar 10, 2020
Merged

refactor: fix alignment of menu dropdown components #1770

merged 8 commits into from
Mar 10, 2020

Conversation

dated
Copy link
Contributor

@dated dated commented Mar 4, 2020

Summary

The position of the MenuDropdown components is currently changed by translating the element relative to its own position. This is error prone and exact alignment of multiple components becomes problematic, as can be see on the profile edition page:

image

With this PR the components are positioned relative to their parents and the prop type has been changed to be an object with the following base values. x or y can be ommitted when passing the prop.

position = {
  x: '0',
  y: '120%'
}

image

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@ghost
Copy link

ghost commented Mar 4, 2020

Thanks for submitting this pull request! A maintainer will review this in the next few days and explicitly select labels so you know what's going on.

If no reviewer appears after a week, a reminder will be sent out.

@ghost ghost added Complexity: Low Less than 64 lines changed. Type: Refactor The pull request improves or enhances an existing implementation. labels Mar 4, 2020
@brenopolanski
Copy link
Contributor

brenopolanski commented Mar 4, 2020

@dated I like your changes. But I was thinking, perhaps a better solution would be to close the dropdown menu if there is a click outside the element. Like normal behavior of a native <select />. Make sense?

See how it looks opening all the dropdown menus:

Screenshot from 2020-03-04 14-12-04

@dated
Copy link
Contributor Author

dated commented Mar 4, 2020

Yea, I'll fix that as well (it's like this on develop also)

@alexbarnsley
Copy link
Member

Would you mind adding a test for the adjustedPosition computed property please

@alexbarnsley alexbarnsley added the Bounty: Tier 4 Awarded for small features, refactorings, improvements. This is valued at 20 USD. label Mar 5, 2020
@dated
Copy link
Contributor Author

dated commented Mar 5, 2020

Would you mind adding a test for the adjustedPosition computed property please

done, cd5e3fb

@dated dated changed the title refactor: fix alignment of menu dropdown components [WIP] refactor: fix alignment of menu dropdown components Mar 5, 2020
@brenopolanski
Copy link
Contributor

@dated have you done this: "close any sibling when opening a menu" ?

@dated
Copy link
Contributor Author

dated commented Mar 6, 2020

Not yet, I'll remove the [WIP] as soon as I'm done.

@alexbarnsley
Copy link
Member

Do the "close any sibling when opening a menu" in another PR. It's an existing issue not related to this

@dated dated changed the title [WIP] refactor: fix alignment of menu dropdown components refactor: fix alignment of menu dropdown components Mar 9, 2020
@dated
Copy link
Contributor Author

dated commented Mar 9, 2020

Thanks @alexbarnsley, I'll open up an issue for it and finish my other stuff first before coming back to it.

@ghost
Copy link

ghost commented Mar 10, 2020

A member has approved this PR. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait.

Thank you for your contribution!

@ghost ghost added the Status: Member Approved The pull request has been approved by a member. label Mar 10, 2020
@faustbrian faustbrian merged commit e3b76ab into ArkEcosystem:develop Mar 10, 2020
@ghost
Copy link

ghost commented Mar 10, 2020

Your pull request has been merged and marked as tier 4. It will earn you $20 USD.

@dated dated deleted the refactor/menu-dropdown-position branch March 10, 2020 04:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bounty: Tier 4 Awarded for small features, refactorings, improvements. This is valued at 20 USD. Complexity: Low Less than 64 lines changed. Status: Member Approved The pull request has been approved by a member. Type: Refactor The pull request improves or enhances an existing implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants