Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 251e7f5

Browse files
authored
fix: DEV-1563: Fix editing of textarea result (#469)
* fix: DEV-1563: Fix editing of textarea result * fix: DEV-1563: Protect shortcuts from adding text to nonexistent elements
1 parent b4de589 commit 251e7f5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/HtxTextBox/HtxTextBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class HtxTextBox extends React.Component {
9494
}, 100);
9595

9696
renderEdit() {
97-
const { className = "", rows = 1, onlyEdit, name, onFocus, ...props } = this.props;
97+
const { className = "", rows = 1, onlyEdit, name, onFocus, onChange, ...props } = this.props;
9898
const { height, value } = this.state;
9999

100100
const inputProps = {

src/tags/control/TextArea/TextArea.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ const Model = types.model({
226226
onShortcut(value) {
227227
if (isFF(FF_DEV_1564_DEV_1565)) {
228228
if (!lastActiveElement || !lastActiveElementModel || !isAlive(lastActiveElementModel)) return;
229+
// Do nothing if active element is disappeared
230+
if (self === lastActiveElementModel && !self.showSubmit) return;
231+
if (!lastActiveElement.parentElement) return;
229232

230233
lastActiveElement.setRangeText(value, lastActiveElement.selectionStart, lastActiveElement.selectionEnd, "end");
231234
lastActiveElementModel.setValue(lastActiveElement.value);

0 commit comments

Comments
 (0)