输入位于模态对话框内.我不知道它为什么不起作用.我查看了官方文档,它列出了焦点,你可以传递给元素,但它不起作用?
有谁知道为什么?
<form class="example-form">
<md-input-container class="example-full-width" style="width: 300px; padding: 5px; border-radius: 10px;">
<input mdInput type="email" name="to" placeholder="Email">
<md-error></md-error>
</md-input-container>
<md-input-container focus focused>
<input mdInput type="text" name="a" placeholder="zzzz" focus focused (focus)="">
</md-input-container>
</form>
Run Code Online (Sandbox Code Playgroud) 我已经解决了其他类似的问题来解决这个问题,但在这种情况下,所有解决方案都无法正常工作.
所以这是我的示例片段的问题:
我有一个html文件,看起来像这样:
<div id="portalRight">
<a target="_blank" href="http://ictforu.com"> <!-- this link works , it opens up another tab -->
<ul id="subtabnav">
<li class="datasetTab">
<a href="#">dataset</a> <!-- Click on this will trigger the dataset iframe to be loaded thru a servlet call -->
</li>
<li class="obsGraphTab" data-bind="css: { disabled: !aekos.subTabViewModel.graphTabsEnabled() }">
<a href="#">Observation Graph</a>
</li>
.....
</ul>
<div id="dataset">
<iframe id="dataset-frame" class="graphiframe" seamless sandbox="allow-same-origin allow-scripts"></iframe>
</div>
<div id="testViewer">
<iframe id="test-viewer-frame" class="graphiframe" seamless sandbox="allow-same-origin allow-scripts"></iframe>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,我iframe
不是弹出窗口,而是出现在div
元素下: …
我正在使用角度材料设计。我打开了一个材质对话框,其中有一个材质按钮。
对话框打开时材质按钮处于选择状态
我正在根据属性有条件地渲染模态组件display
。
show
我需要在组件/上实现切换主体滚动功能hide
。
参见下面的实现,
<button onClick={()=> this.setState({ show: true })}>Show modal</button>
<Modal show={show} containerStyle={containerStyle} position={position} handleClickOutside={()=> this.setState({ show: false })} >
<Content />
</Modal>
Run Code Online (Sandbox Code Playgroud)
componentDidMount() {
disableBodyScroll(this.state.defaultMargin);
}
componentWillUnmount() {
enableBodyScroll(this.state.defaultMargin);
}
render() {
const { show } = this.props;
const display = show ? 'block' : 'none';
return (
<div onClick={ handleClickOutside } className={ styles[ 'modal'] } style={ { display } }>
{children}
</div>
);
}
Run Code Online (Sandbox Code Playgroud)
但问题是在显示模态之前调用了 componentDidMount 函数。我希望在模态显示后调用它
当 Modal 隐藏时,应该调用 componentWillUnmount …