-
Notifications
You must be signed in to change notification settings - Fork 263
Fixes #728 - Use table-cell display for right label #729
Conversation
I just added some screenshots. Please let me know if you see any issues. Thanks for reviewing! |
This appears to have broken some specs - can you please investigate those failures @patrick-steele-idem? Thanks! /cc @simurai |
Any pointers how to visually test the failing tests to know what is happening and why the tests are failing? |
1570290
to
e2fdd66
Compare
@50Wliu @simurai I spent more time than I would like to admit investigating the failures, and while I was able to fix one of the tests, I am at a loss while the two tests are failing... Since I was not able to visually see the editor when running the tests I took the time to reproduce the tests by creating the same provider that the failing tests were using. When I tested in my editor everything was working exactly as expected and the overlay is positioned exactly where it should be as shown in the screenshot below: I'm really hoping someone else can take a look and let me know what I am missing. Is there some setting that I am missing that is impacting the test? Is there a way to see what the editor looks like when running the tests? Any help would be greatly appreciated. Thanks in advance. |
I don't believe so, sorry. I'm afraid I can't help much with the tests either, but it looks like the failures start happening after you backspace past a space. Did you test that? I'm not quite sure based on your screenshot. |
Yeah, that's exactly what I did to produce my screenshot. Unfortunately, the screenshot did not capture the cursor position (I probably should have done an animated gif in retrospect). By the way, the test is only failing because of the change to move the What are your thoughts on resolving the failing test? The test itself seems fine and I am not seeing the problem visually which is what is frustrating... |
Another issue is that when all 4 spans are filled up, it starts to scroll horizontally. It is already broken on It seems that the Edit: Actually the horizontal scrolling is caused because there is a max width 800px, so fix might be to just make the middle word element smaller so that the |
if all spans are filled
@patrick-steele-idem ok, there is now a PR patrick-steele-idem#1 that might help with this PR. |
Update: I merged in some additional fixes from @simurai (thank you!) and that resolved the tests. I did some additional visual testing and made one more tweak to resolve a horizontal scroll bar when the right label was long. I think we are good to go, but please let me know if you still see any problems. Thanks! |
@@ -59,6 +59,7 @@ autocomplete-suggestion-list.select-list.popover-list { | |||
margin-top: 0; | |||
display: table; | |||
width: 100%; | |||
margin-right: 10px; // Needed to prevent horizontal scrolling when right label is too long |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am on OSX. It's very strange that you aren't seeing the issue. I've configured the font-size
to be 13px
and I am using the Hack font, but other than that my styles are pretty standard. I am using the Atom Dark
theme. Here's two recordings to show the issue:
Without margin-right: 10px
(bad horizontal scroll bar)
With margin-right: 10px
(no horizontal scroll bar)
I have only had a glance at this as I cannot reproduce this exact behaviour yet, but wanted to share my concerns about this PR:
autocomplete-suggestion-list.select-list.popover-list {
max-width: 800px;
}
autocomplete-suggestion-list {
.left-label {
max-width: 150px;
}
.right-label {
max-width: 150px;
}
.word {
max-width: 500px;
}
} With all this in mind I wonder whether it would be simpler to refactor the existing stylesheet to use Flexbox instead? That would likely improve the use of whitespace as well. |
👍 @designorant flexbox would solve the issue with something simple as autocomplete-suggestion-list {
display: flex;
.left-label {
flex: 0 0 25%;
}
.right-label {
flex: 0 0 25%;
}
.word {
flex: 50%;
}
} Using percents would also make the grid being responsive, not depending on an hard-coded |
So if I understood it right, it goes something like this: Flexbox would be nice if the proportions should be predefined (
Buuut.. there are issues with the table growing uncontrollably wide. The I agree that it feels a bit ugly, but maybe still an ok compromise for the feature it allows? |
Yes, that could be removed. And even rename |
Ok, let's merge this since it fixes something that currently looks broken. @patrick-steele-idem Thanks! 🙇 |
Fixes #728
This PR includes a simple change to move the right-label span up one level so that it will be displayed as a
table-cell
instead of usingfloat: right
. This fixes layout problems by ensuring that the right label always has enough space reserved to avoid lines shifting down.Before change:
After change:
After change, with a really long suggestion: