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

Carousel 组件结合Layout.Content 和Layout.Sider 组件使用宽度超出屏幕 #5415

Closed
K-walker opened this issue Mar 21, 2017 · 11 comments · Fixed by #5480
Closed

Carousel 组件结合Layout.Content 和Layout.Sider 组件使用宽度超出屏幕 #5415

K-walker opened this issue Mar 21, 2017 · 11 comments · Fixed by #5480
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug.

Comments

@K-walker
Copy link

使用Layout组件进行布局,发现在Content组件中嵌套Carousel组件,在有Sider组件的情况下,Carousel组件宽度会超出屏幕,下面会出现滚动条,代码如下:

class Main extends React.Component {
	render () {
		return (
			<Layout>
				<Layout>
					<Content>
						<Carousel autoplay dots="false" >
							<div>1</div>
							<div>2</div>
							<div>3</div>
						</Carousel>
					</Content>
					<Sider></Sider>
				</Layout>
			</Layout>
		)
	}
}

如果把Sider组件去掉,就能正常显示,加上Sider组件,Carousel组件的宽度就会超出屏幕,这算不算bug啊,求解!

@K-walker
Copy link
Author

找到解决方法了,给Content 组件加个 overflow:hidden 即可

@benjycui
Copy link
Contributor

找到解决方法了,给Content组件加个 overflow:hidden 即可

这个会把 Carousel 给裁剪掉一部分吧?

Please provide a re-producible demo: http://codepen.io/benjycui/pen/KgPZrE?editors=001

@benjycui benjycui reopened this Mar 21, 2017
@huyawei
Copy link

huyawei commented Mar 21, 2017

@benjycui
Copy link
Contributor

@huyawei 只给 demo,不描述问题,看不懂的。

@huyawei
Copy link

huyawei commented Mar 22, 2017

@benjycui (⊙o⊙)… 我是帮lz回答的 加了 overflow:hidden没问题
里面放了两个 layout 第一个对content加了overflow hidden
第二个是lz的代码

@K-walker
Copy link
Author

@benjycui 我的问题已经描述很清楚了啊,上面就是我的代码啊

@afc163
Copy link
Member

afc163 commented Mar 22, 2017

@K-walker

一个可重现的 codpen 能节约很多时间 😃,就像 @huyawei 帮助提供的那样。

@K-walker
Copy link
Author

@afc163 我昨天注册了半天,硬是没收到codepen的邮件,所以用不了,好忧桑

@afc163
Copy link
Member

afc163 commented Mar 22, 2017

不用注册的,我都是匿名用。

(我一登录就跳转死循环 😓 )

@K-walker
Copy link
Author

@afc163 好了,这是问题demo GWxBoe 问题的描述我写在css 注释中。

@benjycui benjycui added the 🐛 Bug Ant Design Team had proved that this is a bug. label Mar 22, 2017
@lock
Copy link

lock bot commented May 1, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Ant Design Team had proved that this is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants