Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent layout shift on hover in libs/board manager #1568

Merged
merged 3 commits into from
Oct 25, 2022

Conversation

francescospissu
Copy link
Contributor

@francescospissu francescospissu commented Oct 20, 2022

Motivation

At present in the IDE2 when hovering over an item in the library or board manager the item height changes, shifting the position of all library items in the manager. We should avoid this behavior because it is not ideal and could be considered "inaccessible."

Change description

Retain the version drop-down and the install button always visible in the item.

image

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@francescospissu francescospissu added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 20, 2022
@francescospissu francescospissu self-assigned this Oct 20, 2022
@francescospissu francescospissu linked an issue Oct 24, 2022 that may be closed by this pull request
3 tasks
Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

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

It works fine to me, I've just left a trivial remark to slightly improve the html.

if (!this.state.versionUpdate) this.setState({ focus: false });
}}
>
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Having a div here is superfluous at this point. Please replace it with a react fragment (<>...</>).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replaced it here. Thanks 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

even the fragment is superfluous we can just return the node no?

return itemRenderer.renderItem(
    Object.assign(this.state, { item }),
    this.install.bind(this),
    this.uninstall.bind(this),
    this.onVersionChange.bind(this)
);

@francescospissu francescospissu marked this pull request as ready for review October 24, 2022 14:14
@AlbyIanna AlbyIanna self-requested a review October 24, 2022 16:42
Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

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

Thank you @francescospissu ! It's looking great now 🍕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent layout shift on hover in the library/boards manager UI
4 participants