Made Edit Post Modal autocomplete always attach to the bottom of the textarea (#4956)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
95172f1b4b
Коммит
b3f2ab654e
@@ -126,7 +126,7 @@ export default class SwitchChannelModal extends React.Component {
|
|||||||
const message = this.state.error;
|
const message = this.state.error;
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
className='modal-browse-channel'
|
dialogClassName='channel-switch-modal'
|
||||||
ref='modal'
|
ref='modal'
|
||||||
show={this.props.show}
|
show={this.props.show}
|
||||||
onHide={this.onHide}
|
onHide={this.onHide}
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ export default class EditPostModal extends React.Component {
|
|||||||
channelId={this.state.channel_id}
|
channelId={this.state.channel_id}
|
||||||
createMessage={Utils.localizeMessage('edit_post.editPost', 'Edit the post...')}
|
createMessage={Utils.localizeMessage('edit_post.editPost', 'Edit the post...')}
|
||||||
supportsCommands={false}
|
supportsCommands={false}
|
||||||
|
suggestionListStyle='bottom'
|
||||||
id='edit_textbox'
|
id='edit_textbox'
|
||||||
ref='editbox'
|
ref='editbox'
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -21,6 +21,24 @@ const PreReleaseFeatures = Constants.PRE_RELEASE_FEATURES;
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export default class Textbox extends React.Component {
|
export default class Textbox extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
id: React.PropTypes.string.isRequired,
|
||||||
|
channelId: React.PropTypes.string,
|
||||||
|
value: React.PropTypes.string.isRequired,
|
||||||
|
onChange: React.PropTypes.func.isRequired,
|
||||||
|
onKeyPress: React.PropTypes.func.isRequired,
|
||||||
|
createMessage: React.PropTypes.string.isRequired,
|
||||||
|
onKeyDown: React.PropTypes.func,
|
||||||
|
onBlur: React.PropTypes.func,
|
||||||
|
supportsCommands: React.PropTypes.bool.isRequired,
|
||||||
|
handlePostError: React.PropTypes.func,
|
||||||
|
suggestionListStyle: React.PropTypes.string
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
supportsCommands: true
|
||||||
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
@@ -242,6 +260,7 @@ export default class Textbox extends React.Component {
|
|||||||
onHeightChange={this.handleHeightChange}
|
onHeightChange={this.handleHeightChange}
|
||||||
style={{visibility: this.state.preview ? 'hidden' : 'visible'}}
|
style={{visibility: this.state.preview ? 'hidden' : 'visible'}}
|
||||||
listComponent={SuggestionList}
|
listComponent={SuggestionList}
|
||||||
|
listStyle={this.props.suggestionListStyle}
|
||||||
providers={this.suggestionProviders}
|
providers={this.suggestionProviders}
|
||||||
channelId={this.props.channelId}
|
channelId={this.props.channelId}
|
||||||
value={this.props.value}
|
value={this.props.value}
|
||||||
@@ -272,20 +291,3 @@ export default class Textbox extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Textbox.defaultProps = {
|
|
||||||
supportsCommands: true
|
|
||||||
};
|
|
||||||
|
|
||||||
Textbox.propTypes = {
|
|
||||||
id: React.PropTypes.string.isRequired,
|
|
||||||
channelId: React.PropTypes.string,
|
|
||||||
value: React.PropTypes.string.isRequired,
|
|
||||||
onChange: React.PropTypes.func.isRequired,
|
|
||||||
onKeyPress: React.PropTypes.func.isRequired,
|
|
||||||
createMessage: React.PropTypes.string.isRequired,
|
|
||||||
onKeyDown: React.PropTypes.func,
|
|
||||||
onBlur: React.PropTypes.func,
|
|
||||||
supportsCommands: React.PropTypes.bool.isRequired,
|
|
||||||
handlePostError: React.PropTypes.func
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -24,10 +24,6 @@
|
|||||||
min-height: 8em;
|
min-height: 8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.suggestion-list {
|
|
||||||
bottom: -149px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.suggestion-list__content {
|
.suggestion-list__content {
|
||||||
max-height: 150px;
|
max-height: 150px;
|
||||||
}
|
}
|
||||||
@@ -669,3 +665,9 @@
|
|||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.channel-switch-modal {
|
||||||
|
.modal-body {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,11 @@
|
|||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.suggestion-list--bottom {
|
||||||
|
position: relative;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.suggestion-list__content {
|
.suggestion-list__content {
|
||||||
background-color: $white;
|
background-color: $white;
|
||||||
border: $border-gray;
|
border: $border-gray;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user