design-system-react icon indicating copy to clipboard operation
design-system-react copied to clipboard

Toast Blocking Links on Same Horizontal Line

Open kwilloughby opened this issue 10 years ago • 15 comments

Please see the image below. The Toast won't let me click on the logo or the "View on GitHub" link. This is an issue when the component is used in the Marketing Cloud as well.

image

kwilloughby avatar Sep 13 '16 22:09 kwilloughby

Note, the icon color and close button issues are referenced on a different ticket (https://github.com/salesforce-ux/design-system-react/issues/673).

kwilloughby avatar Sep 13 '16 22:09 kwilloughby

@pixelprodotco for visibility.

kwilloughby avatar Sep 14 '16 22:09 kwilloughby

I've looked into this, and it's a problem with SLDS itself, not specifically a DSR issue.

Having said that, we will of course try to get it rectified.

Hopefully, we don't have to wind up making the container width auto and calculating position based on window width and stuff, but I'm afeard that's what will end up happening. :(

@stefsullrew @jina @donnieberg ...anyone I'm missing?

chriscorwin avatar Nov 03 '16 15:11 chriscorwin

A toast is in a fixed container (which you can't see). Since there can be multiple toasts in that container, it's necessary. Is there a reason someone wouldn't dismiss the toast before trying to click the links?

stefsullrew avatar Nov 03 '16 18:11 stefsullrew

what she said -------^

@kwilloughby

chriscorwin avatar Nov 04 '16 13:11 chriscorwin

Is there a reason someone wouldn't dismiss the toast before trying to click the links?

Oh, yeah, there might be: Create record, try to modify record, system fails to save changes, blocks your action, notifies with toast, you bail and wanna click home.... can't.

Of course, then you could just dismiss it, but.... it might not occur to all users that HEY THIS THING IS BLOCKING MAH LINK they might just think HEY MAH LINK NO WORK :(

chriscorwin avatar Nov 04 '16 13:11 chriscorwin

In places where necessary, the engineer could code the the app to find .slds-notify-container and do the math to move it to where it needs to be, vertically, or even, ugh, horizontally, if they are VERY VERY DEFENSIVE about it.

Example of moving it vertically down so that it isn't blocking the masthead

screenshot 2016-11-04 09 33 38

But this would all be done at the app level, not in the library itself.

The toast component can not, and should not, know or care what is behind it.

So, in other words, @kwilloughby: the person implementing your design can account for such blocking and code around it if necessary, but....

The "bug" here is not with DSR nor with SLDS, it's having an app that would have a notification that is important enough to be showing long enough that it would block what's below it, but isn't, for some reason, a modal.

IOW, I think this is actually a "will not fix".

@futuremint and @interactivellama, do you agree?

chriscorwin avatar Nov 04 '16 13:11 chriscorwin

I understand and agree with the “will not fix” since this isn’t specific to DSR. We’re currently using it as a success confirmation which we are dismissing automatically after a few seconds so this isn’t a blocker.

In instances where that’s not an option, it’s not obvious that the user has to click on the X first since there isn’t any visual indication (e.g. white mask). The fact that the user can click on other items on the page goes against clarity and consistency (possibly even efficiency).

Since this goes beyond DSR, I’m happy to discuss it further. @raymonst, thoughts on this ticket?

CC @jamin-hall

kwilloughby avatar Nov 04 '16 15:11 kwilloughby

@chriscorwin @stefsullrew Would you be opposed to adding { width: auto, left: 50%, transform: translateX(-50%) } to the .slds-notify-container? That way the container only takes up as much space as it needs and doesn't block things behind it (I think..). If you're cool with this, I'll add it to my open PR to fix the Notification icon bugs.

From donielle ^

If this is a thing that works for us, is there a reason it should not land as the default style in SLDS? @stefsullrew

Because I really really really really really hate overriding SLDS.

Like.... a heap. From Chris I think ^ lol

donnieberg avatar Nov 04 '16 17:11 donnieberg

Actually, that works well, @donnieberg:

screenshot 2016-11-04 14 25 54

I like it even better than what you get with the default style and two toasts open:

screenshot 2016-11-04 14 27 04

chriscorwin avatar Nov 04 '16 18:11 chriscorwin

Note that while trying to get two toasts open I discovered that DSR doesn't actually let you do that, because each toast provides its own .slds-notify-container, and just plops any additional ones right over the first one, rather than stacking them.

I had to manually modify the rendered output in devtools to get them both into one container.

This is, I'm pretty sure, something that needs to be fixed, so I've created an issue for it: #760

chriscorwin avatar Nov 04 '16 18:11 chriscorwin

I don't mind having the toast's invisible container be less than full width to allow users to click outside of toasts.

However, multiple toasts should stack vertically. They should not be side by side.

raymonst avatar Nov 04 '16 18:11 raymonst

Thanks for creating a new issue for the stacking, @chriscorwin. I'll include the fix for this issue in my PR :) Thanks for your input @raymonst! You're a swell person.

donnieberg avatar Nov 04 '16 21:11 donnieberg

So, I already merged this, but.. it's still not behaving like I think we want for multiple toasts, so I'm gonna work on #760 real quick.

chriscorwin avatar Nov 07 '16 15:11 chriscorwin

Thanks for making toasts not full width.

On a side note: @stefsullrew Seems like some kind of visual would be present if we are intentionally blocking UI--like a half modal/half dialog gray background.

interactivellama avatar Nov 11 '16 18:11 interactivellama