Skip to content

Commit

Permalink
Fix mention active style
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Mar 18, 2017
1 parent 8afc2e9 commit 240a93c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion components/form/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ form {
border-color: @error-color;
}
}
&.active .@{ant-prefix}-mention-editor,
&.@{ant-prefix}-mention-active .@{ant-prefix}-mention-editor,
.@{ant-prefix}-mention-editor:not([disabled]):focus {
.active(@error-color);
}
Expand Down
3 changes: 2 additions & 1 deletion components/mention/demo/controlled.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class App extends React.Component {
id="control-mention"
label="Top coders"
labelCol={{ span: 6 }}
wrapperCol={{ span: 14 }}
wrapperCol={{ span: 16 }}
>
{getFieldDecorator('mention', {
rules: [
Expand All @@ -65,6 +65,7 @@ class App extends React.Component {
})(
<Mention
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
style={{ height: 60 }}
/>
)}
</FormItem>
Expand Down
28 changes: 15 additions & 13 deletions components/mention/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
@import "../../style/mixins/index";
@import '../../input/style/mixin';

.@{ant-prefix}-mention-wrapper {
@mention-prefix-cls: ~"@{ant-prefix}-mention";

.@{mention-prefix-cls}-wrapper {
position: relative;
display: inline-block;
width: 100%;
vertical-align: middle;
&-active .@{ant-prefix}-mention-editor {
.active;
}
.@{ant-prefix}-mention-editor {
.input;
padding: 0;
display: block;
.@{mention-prefix-cls}-editor {
.input;
padding: 0;
display: block;
&-wrapper {
overflow-y: auto;
height: auto;
}
}
.@{ant-prefix}-mention-editor-wrapper {
overflow-y: auto;
height: auto;
&.@{mention-prefix-cls}-active .@{mention-prefix-cls}-editor {
.active;
}
.public-DraftEditorPlaceholder-root {
position: absolute;
Expand All @@ -37,7 +39,7 @@
}
}

.@{ant-prefix}-mention-dropdown {
.@{mention-prefix-cls}-dropdown {
margin-top: 1.5em;
max-height: 250px;
min-width: 120px;
Expand All @@ -53,7 +55,7 @@
overflow-x: hidden;
overflow-y: auto;
font-size: @font-size-base;
&-notfound.@{ant-prefix}-mention-dropdown-item {
&-notfound&-item {
color: @disabled-color;

.@{iconfont-css-prefix}-loading {
Expand Down

0 comments on commit 240a93c

Please sign in to comment.