carbon-react 128.4.0 → 128.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -192,12 +192,12 @@ const TextEditor = /*#__PURE__*/React.forwardRef(({
|
|
|
192
192
|
};
|
|
193
193
|
const handleEditorFocus = useCallback(focusValue => {
|
|
194
194
|
moveCursor.current = true;
|
|
195
|
-
|
|
196
|
-
if (!isFocused && focusValue && typeof editor === "object" && editor.current !== document.activeElement) {
|
|
195
|
+
if (focusValue && typeof editor === "object" && editor.current !== document.activeElement) {
|
|
197
196
|
editor.current?.focus();
|
|
198
197
|
setFocusToolbar(false);
|
|
199
198
|
}
|
|
200
|
-
|
|
199
|
+
setIsFocused(focusValue);
|
|
200
|
+
}, [editor]);
|
|
201
201
|
const handleInlineStyleChange = (ev, style) => {
|
|
202
202
|
ev.preventDefault();
|
|
203
203
|
setActiveInlines({
|
|
@@ -201,12 +201,12 @@ const TextEditor = exports.TextEditor = /*#__PURE__*/_react.default.forwardRef((
|
|
|
201
201
|
};
|
|
202
202
|
const handleEditorFocus = (0, _react.useCallback)(focusValue => {
|
|
203
203
|
moveCursor.current = true;
|
|
204
|
-
|
|
205
|
-
if (!isFocused && focusValue && typeof editor === "object" && editor.current !== document.activeElement) {
|
|
204
|
+
if (focusValue && typeof editor === "object" && editor.current !== document.activeElement) {
|
|
206
205
|
editor.current?.focus();
|
|
207
206
|
setFocusToolbar(false);
|
|
208
207
|
}
|
|
209
|
-
|
|
208
|
+
setIsFocused(focusValue);
|
|
209
|
+
}, [editor]);
|
|
210
210
|
const handleInlineStyleChange = (ev, style) => {
|
|
211
211
|
ev.preventDefault();
|
|
212
212
|
setActiveInlines({
|