Comments (7)
bootstrap 和 semantic-ui 的交互是超过高度时可以滚动,但背景还是固定的。
from dialog.
目前结构不好实现,先不做
from dialog.
@yiminghe 很需要这个,接受 PR 吗?
from dialog.
感觉这样体验会好一些:http://getbootstrap.com/javascript/#live-demo
from dialog.
是的,就是想要这样的效果
from dialog.
欢迎 pr @yesmeck
from dialog.
一个应急的办法,项目中实在需要等不及了,改动一些基础代码,和bootstrap中的modal一样了,希望对大家的项目能有帮助....
find rc-dialog/lib/Dialog.js and modify as fellow:
first place:
var className = _defineProperty({}, prefixCls + '-wrap', 1);
if (props.visible) {
className = _defineProperty({}, prefixCls + '-wrap '+prefixCls+'-wrap-open', 1);
}
second place:
[this.getMaskElement(), this.getDialogElement()]
change to
[this.getDialogElement()]
third place:
find function 'componentDidUpdate'
componentDidUpdate: function componentDidUpdate(prevProps) {
var props = this.props;
if (props.visible) {
// first show
if (!prevProps.visible) {
this.lastOutSideFocusNode = document.activeElement;
_reactDom2['default'].findDOMNode(this.refs.dialog).focus();
}
/**
* gary modified start
*/
if(document.body.className.indexOf("ant-modal-open")<0){
document.body.className += " ant-modal-open"
}
/**
* gary modified end
*/
} else if (prevProps.visible) {
if (props.mask && this.lastOutSideFocusNode) {
try {
this.lastOutSideFocusNode.focus();
} catch (e) {
this.lastOutSideFocusNode = null;
}
this.lastOutSideFocusNode = null;
}
/**
* gary modified start
*/
if(document.body.className.indexOf("ant-modal-open")>=0){
document.body.className -= " ant-modal-open"
}
/**
* gary modified end
*/
}
}
at last:
add fellow code into your custom css file
.ant-modal-wrap-open{
position:absolute;
overflow-y:auto;
background-color: rgba(55, 55, 55, 0.6);
bottom: 0;
height: 100%;
left: 0;
right: 0;
top: 0;
z-index: 990;
}
.ant-modal-open{
overflow-y: hidden;
}
from dialog.
Related Issues (20)
- Scrollbar space reserved when there's no scrollbar HOT 1
- Why binding mask handlers on wrap element instand of mask element?
- Missing aria-modal=true attribute HOT 1
- in antd lastest, modal destory when close, and i don't set destroyOnClose
- prefixCls 支持自定义 HOT 23
- Cannot test with enzyme and jest
- when using next.js with SSR there is a bug shows " Expected server HTML to contain a matching <div> in <div> " HOT 4
- Accessibility error: ARIA hidden element must not contain focusable elements
- Error: "export 'useId' (imported as 'React') was not found in 'react'"after upgrading to v8.8.1 HOT 2
- autoFocus input not working within dialog
- autoLock for portal should be configurable
- Failed to resolve entry for package "rc-util" error when upgrade version HOT 1
- static aria-label, no possibility to change for other language HOT 3
- 有没有安卓版啊
- There is no way to disable the close button HOT 1
- rc-dialog with typescript HOT 1
- can not work with react-draggable
- Add forceRender props HOT 1
- option to prevent focusing lastOutSideFocusNode when closing the dialog
- bootstrap example doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dialog.