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: adding overflow-wrap to dropdown #451 #482

Merged
merged 6 commits into from
Jan 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/menu/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ governing permissions and limitations under the License.
.spectrum-Menu-itemLabel {
flex: 1 1 auto;
line-height: var(--spectrum-selectlist-option-label-line-height);
word-break: break-all;
hyphens: auto;
overflow-wrap: break-word;
width: 80%;
Copy link
Member

Choose a reason for hiding this comment

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

80% is a bit arbitrary. Should this be calc(100% - whatever space we need for an icon)?

Copy link
Member

Choose a reason for hiding this comment

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

calc should be a good solution. I don't have IE 11 set up on my main machine. What solution are you using now for testing ie11? bootcamp?

Copy link
Member

Choose a reason for hiding this comment

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

@GarthDB I have a VM for it, Windows 8.1 IE 11, I believe it's this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Windows 8 instance is not supported anymore, it is recommended to use the Windows 10 instance that also has IE11 and MS Edge.
You can use VMWare fusion V11. (full setup here including serial number https://adobe.service-now.com/sc?id=kb_article&sys_id=1f47158d1bfd00d04bd1620f6e4bcbc4) or via SMB: smb://sjstore.corp.adobe.com/Labs/VMware/Fusion
You can download the latest supported Windows 10 here or ping me and I can send you the the fully configured VMWare fusion disk image (https://labvmlibrary.corp.adobe.com seems to be unresponsive at this time)

About using calc: It's only partially supported in IE11 (https://caniuse.com/#feat=calc) and will look like this in this scenario after gulp build (please ignore the background color, it's only demonstrating the width).

using width: calc(100% - (var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-selectlist-option-icon-padding-x))); seems to work.

Screenshot in Chrome:
Screen Shot 2020-01-22 at 02 29 04

Screenshot in IE11:
Screen Shot 2020-01-22 at 02 28 54

Copy link
Member

Choose a reason for hiding this comment

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

@bernhard-adobe I'm aware that calc is partially supported in IE 11, and looking again at the known issues, none of them are relevant to our use case. Why did you bring it up? Is there something I missed? From your screenshot, it looks totally correct in IE11, right?

I'm not worried about the unsupported VM, it works perfectly fine, but thanks for the info!

Copy link
Contributor Author

@bernhard-adobe bernhard-adobe Jan 23, 2020

Choose a reason for hiding this comment

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

using width: calc(100% - (var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-selectlist-option-icon-padding-x))); seems to work.

I mentioned earlier in my comment that I agreed to this testing of calc and it seems to work here.

Some known issues with calc in IE11 that could cause potential rendering issues (under "bugs" https://docs.w3cub.com/browser_support_tables/calc/):

  • unknown total width of the entire context menu, aka width is not set
  • auto-generated content gets set wrong width

}

.spectrum-Menu-itemLabel--wrapping {
Expand Down