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(modal): add padding to overflow indicator, sets hasScrollingContent default to false #4775

Merged
merged 7 commits into from
Dec 10, 2019
Merged

Conversation

abbeyhrt
Copy link
Contributor

@abbeyhrt abbeyhrt commented Nov 25, 2019

This resolves the problem you can see here
Screen Shot 2019-11-21 at 11 12 32 AM by setting the default of hasScrollingContent to false. Adds padding to modal content's last child so the overflow indicator goes away when the bottom of the content is hit.

Changelog

Changed

  • hasScrollingContent prop to false by default.
  • changes padding-bottom of modal content to 2rem

Removes

  • carbon-- from spacing tokens.

Testing / Reviewing

Go to the modal content examples and make sure that the overflow indicator shadow goes away when the bottom of the content is reached and that the modal content isn't fading when there is no scrollable content.

@abbeyhrt abbeyhrt requested a review from a team as a code owner November 25, 2019 22:58
@ghost ghost requested review from aledavila and joshblack November 25, 2019 22:59
@netlify
Copy link

netlify bot commented Nov 25, 2019

Deploy preview for the-carbon-components ready!

Built with commit 3d2c2c2

https://deploy-preview-4775--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Nov 25, 2019

Deploy preview for carbon-components-react ready!

Built with commit 3d2c2c2

https://deploy-preview-4775--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Nov 25, 2019

Deploy preview for carbon-elements ready!

Built with commit 3d2c2c2

https://deploy-preview-4775--carbon-elements.netlify.com

Copy link
Contributor

@asudoh asudoh 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 for the fix @abbeyhrt!

@@ -372,6 +373,8 @@ export default class Modal extends Component {
}
: {};

console.log(hasScrollingContent);
Copy link
Contributor

Choose a reason for hiding this comment

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

You meant to remove this, right?

@@ -168,7 +168,7 @@ export default class Modal extends Component {
modalLabel: '',
selectorPrimaryFocus: '[data-modal-primary-focus]',
focusTrap: true,
hasScrollingContent: true,
hasScrollingContent: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change - Any more details wrt why you thought we need this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think actually having it set to true was the breaking change because existing code would have to be updated because of aria-label now needing to be defined and there is no default value for it specified for this component.

Copy link
Member

Choose a reason for hiding this comment

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

just for some context the default value was initially decided in #3943 (comment), but since we now have a gradient to indicate scrolling content I guess we will default back to hasScrollingContent = false?

Copy link
Contributor

Choose a reason for hiding this comment

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

@emyarod yeah, I think things got confused in the long thread. I think the reason we can't default to true is that it would break existing usage (as they don't specify aria-label). But if they include the prop, aria-label should be set. I don't think this is included in a stable version yet so can revert safely but will defer to you all in case it has been included 👍

@netlify
Copy link

netlify bot commented Nov 25, 2019

Deploy preview for carbon-elements failed.

Built with commit ddcf33d

https://app.netlify.com/sites/carbon-elements/deploys/5deecec75c1e98000842074e

@netlify
Copy link

netlify bot commented Nov 25, 2019

Deploy preview for carbon-components-react ready!

Built with commit ddcf33d

https://deploy-preview-4775--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Nov 25, 2019

Deploy preview for the-carbon-components ready!

Built with commit ddcf33d

https://deploy-preview-4775--the-carbon-components.netlify.com

@joshblack joshblack changed the title fix(modal): add padding to overflow indicator, sets hasScrollingContent default to true fix(modal): add padding to overflow indicator, sets hasScrollingContent default to false Nov 26, 2019
Co-Authored-By: Josh Black <josh@josh.black>
Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

As long as we announce the change as part of release the change is good - Thanks @abbeyhrt!

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

seems like there's a prettier formatting error?

@abbeyhrt
Copy link
Contributor Author

abbeyhrt commented Dec 3, 2019

@emyarod I'll address that! I noticed that the solution doesn't seem to work in Firefox so I'm looking into fixing that as well

@abbeyhrt
Copy link
Contributor Author

abbeyhrt commented Dec 4, 2019

@emyarod I fixed the FF issue and ci is passing now if you want to review!

@joshblack
Copy link
Contributor

Has this feature been included in a release yet? If not, then I don't think there is a need to communicate this. Let me know if that's not the case 👀

@joshblack
Copy link
Contributor

@abbeyhrt is there any way we could update the content to use padding-bottom instead of margin and have this work? Would make the scrollbar on the right hand side span almost the full height which would be great, let me know if this doesn't work with the gradient though 👍

@abbeyhrt
Copy link
Contributor Author

abbeyhrt commented Dec 9, 2019

@joshblack I believe that's what I had before but it didn't fix the problem in Firefox, I think because of how it interprets position: absolute

@joshblack
Copy link
Contributor

I think we could figure out the padding bit, but also noticed this weird clipping thing:

image

Did you notice it as well? On the bottom edge, seems like the outline is getting overlapped by the content

@asudoh asudoh merged commit 8c27930 into carbon-design-system:master Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants