PLT-4404/PLT-4578/PLT-4541/PLT-4542 Replaced third party autosizing textarea with a custom one (#4442)
* PLT-4578 Replaced third party autosizing textarea with a custom one * Fix Textbox.handleHeightChange not being called * Removed unused CSS * PLT-4541 Force EditPostModal to resize upon opening * Removed usage of jquery from AutosizeTextarea * Reverted changes made for PLT-4580 as they're no longer needed
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
7403bbce69
Коммит
e63e80dee0
@@ -25,6 +25,7 @@ export default class Textbox extends React.Component {
|
||||
super(props);
|
||||
|
||||
this.focus = this.focus.bind(this);
|
||||
this.recalculateSize = this.recalculateSize.bind(this);
|
||||
this.getStateFromStores = this.getStateFromStores.bind(this);
|
||||
this.onRecievedError = this.onRecievedError.bind(this);
|
||||
this.handleKeyPress = this.handleKeyPress.bind(this);
|
||||
@@ -91,13 +92,10 @@ export default class Textbox extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleHeightChange(height) {
|
||||
const textbox = $(this.refs.message.getTextbox());
|
||||
handleHeightChange(height, maxHeight) {
|
||||
const wrapper = $(this.refs.wrapper);
|
||||
|
||||
const maxHeight = parseInt(textbox.css('max-height'), 10);
|
||||
|
||||
// move over attachment icon to compensate for the scrollbar
|
||||
// Move over attachment icon to compensate for the scrollbar
|
||||
if (height > maxHeight) {
|
||||
wrapper.closest('.post-body__cell').addClass('scroll');
|
||||
} else {
|
||||
@@ -106,7 +104,14 @@ export default class Textbox extends React.Component {
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.refs.message.getTextbox().focus();
|
||||
const textbox = this.refs.message.getTextbox();
|
||||
|
||||
textbox.focus();
|
||||
Utils.placeCaretAtEnd(textbox);
|
||||
}
|
||||
|
||||
recalculateSize() {
|
||||
this.refs.message.recalculateSize();
|
||||
}
|
||||
|
||||
showPreview(e) {
|
||||
|
||||
Ссылка в новой задаче
Block a user