mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-24 15:38:45 +08:00
fix metion styles
This commit is contained in:
parent
aa8e02326a
commit
57a34d8f5d
@ -40,11 +40,14 @@ const AsyncMention = React.createClass({
|
||||
},
|
||||
render() {
|
||||
const { suggestions, loading } = this.state;
|
||||
return (<Mention
|
||||
loading={loading}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
/>);
|
||||
return (
|
||||
<Mention
|
||||
style={{ width: 500, height: 100 }}
|
||||
loading={loading}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -50,11 +50,14 @@ const CustomNavMention = React.createClass({
|
||||
},
|
||||
render() {
|
||||
const { suggestions, loading } = this.state;
|
||||
return (<Mention
|
||||
loading={loading}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
/>);
|
||||
return (
|
||||
<Mention
|
||||
style={{ width: 500, height: 100 }}
|
||||
loading={loading}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -21,10 +21,10 @@ function onChange(editorState) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Mention
|
||||
style={{ width: 500, height: 100 }}
|
||||
onChange={onChange}
|
||||
defaultValue={toEditorState('@afc163')}
|
||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||
/>,
|
||||
mountNode
|
||||
);
|
||||
/>
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -55,31 +55,30 @@ let App = React.createClass({
|
||||
initialValue: this.state.initValue,
|
||||
});
|
||||
console.log('>> render', getFieldValue('mention') === this.state.initValue);
|
||||
return (<Form horizontal form={this.props.form}>
|
||||
<FormItem
|
||||
id="control-mention"
|
||||
label="最帅的码农"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}
|
||||
>
|
||||
<Mention
|
||||
{...mentionProps}
|
||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem wrapperCol={{ span: 12, offset: 7 }}>
|
||||
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
|
||||
|
||||
<Button type="ghost" onClick={this.handleReset}>重置</Button>
|
||||
</FormItem>
|
||||
</Form>);
|
||||
return (
|
||||
<Form horizontal form={this.props.form}>
|
||||
<FormItem
|
||||
id="control-mention"
|
||||
label="最帅的码农"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 14 }}
|
||||
>
|
||||
<Mention
|
||||
{...mentionProps}
|
||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem wrapperCol={{ span: 14, offset: 6 }}>
|
||||
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
|
||||
|
||||
<Button type="ghost" onClick={this.handleReset}>重置</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
App = Form.create()(App);
|
||||
ReactDOM.render(
|
||||
<App />,
|
||||
mountNode
|
||||
);
|
||||
|
||||
ReactDOM.render(<App />, mountNode);
|
||||
````
|
||||
|
@ -37,22 +37,22 @@ const CustomNavMention = React.createClass({
|
||||
const filtered = webFrameworks.filter(item =>
|
||||
item.name.toLowerCase().indexOf(searchValue) !== -1
|
||||
);
|
||||
|
||||
const suggestions = filtered.map(suggestion =>
|
||||
<Nav value={suggestion.name} >
|
||||
<span>{suggestion.name} - {suggestion.type} </span>
|
||||
</Nav>);
|
||||
this.setState({
|
||||
suggestions,
|
||||
});
|
||||
this.setState({ suggestions });
|
||||
},
|
||||
render() {
|
||||
const { suggestions, loading } = this.state;
|
||||
return (<Mention
|
||||
loading={loading}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
/>);
|
||||
return (
|
||||
<Mention
|
||||
style={{ width: 500, height: 100 }}
|
||||
loading={loading}
|
||||
suggestions={suggestions}
|
||||
onSearchChange={this.onSearchChange}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -21,11 +21,10 @@ function onChange(editorState) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Mention
|
||||
style={{ width: '100%', height: 200 }}
|
||||
style={{ width: 500, height: 100 }}
|
||||
onChange={onChange}
|
||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
|
||||
multiLines
|
||||
/>,
|
||||
mountNode
|
||||
);
|
||||
/>
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -6,12 +6,14 @@
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
&.active .ant-mention-editor {
|
||||
.active;
|
||||
}
|
||||
.ant-mention-editor {
|
||||
.input;
|
||||
padding: 0;
|
||||
display: block;
|
||||
}
|
||||
.ant-mention-editor-wrapper {
|
||||
overflow-y: auto;
|
||||
@ -95,4 +97,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user