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

Fix author select width #3518

Closed
wants to merge 1 commit into from
Closed

Fix author select width #3518

wants to merge 1 commit into from

Conversation

Rahmon
Copy link
Contributor

@Rahmon Rahmon commented Nov 16, 2017

Description

If the name of author is too large so author select element make sidebar horizontally scrollable. #3432

How Has This Been Tested?

This has been tested with "npm test", "npm run test-e2e" and manually on Chrome and Firefox.

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@@ -1,3 +1,8 @@
.editor-post-author {
width: 100%;
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I removed. Thanks.

@@ -12,7 +12,7 @@ import { PostAuthor as PostAuthorForm, PostAuthorCheck } from '../../components'
export function PostAuthor() {
return (
<PostAuthorCheck>
<PanelRow>
<PanelRow className="editor-post-author">
Copy link
Member

Choose a reason for hiding this comment

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

Since this class is no longer being styled, I'd suggest removing this change (YAGNI).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@aduth
Copy link
Member

aduth commented Nov 27, 2017

Apologies in the delay in revisiting this one, as I was out a large part of last week. It appears that changes made in #3608 have introduced merge conflicts here. You'll need to rebase your branch against the latest master and resolve conflicts, likely with the moving of the file (I'd guess these files were moved without git mv).

If you need help with this, please ping me on core WordPress Slack as @aduth and I'd be happy to walk you through it.

@Rahmon
Copy link
Contributor Author

Rahmon commented Nov 27, 2017

No problem. I'll try do that. Anyway thanks for support.

:)

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

On a final review I encountered a few remaining issues:

  • While width: 100% does prevent overflow, it also causes the select to occupy the full width even if it doesn't need to (i.e. the opposite, short username case)
    • In testing, I found that applying min-width: 0 instead of this change fixed the issue in Chrome, but oddly not in IE11. It seems strange that max-width: 100% has a different effect than width: 100% for constraining. I wasn't able to identify a solution that worked across all browsers; my hunch is something with flexbox, such as flex-shrink on the select.
  • This should apply more generally to elements (selects?) within the Panel component, thinking as a .components-panel__row select style.
    • For example, the same issue occurs if a post format with a long name exists.

@Rahmon
Copy link
Contributor Author

Rahmon commented Nov 30, 2017

I tried use flex-shrink and flex-grow but doesn't work because author select element make sidebar horizontally scrollable.

When I use max-width: 100% author select got the width of div.components-panel__row. So label and select together got bigger than div.components-panel__row.

I've also tried different approach (select in a new line with max-width: 100%):

screenshot from 2017-11-29 22-24-55

@aduth
Copy link
Member

aduth commented Dec 4, 2017

@laras126 tackled this as part of WordCamp US contributor day, so considering this superseded by #3786. Thanks for your work here @Rahmon !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants