@longline/aqua-ui 1.0.315 → 1.0.317

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.
@@ -18,10 +18,13 @@ var BoxWrapperBase = function (props) {
18
18
  // FieldWrapper sends clicks through to the underlying control, and focuses it.
19
19
  // To do so, it looks for the first child control with tabIndex=0.
20
20
  //
21
- var handleClick = function () {
21
+ var handleClick = function (e) {
22
22
  // Find a child element with tabIndex set, and focus/click it.
23
23
  var clickableChild = wrapper.current.querySelectorAll("[tabIndex='0']")[0];
24
24
  if (clickableChild instanceof HTMLElement) {
25
+ // If the click originated from within the control, don't re-click/re-focus it.
26
+ if (clickableChild.contains(e.target))
27
+ return;
25
28
  clickableChild.click();
26
29
  clickableChild.focus();
27
30
  }
@@ -68,7 +68,12 @@ var EditorBase = function (props) {
68
68
  onUpdate: handleUpdate
69
69
  });
70
70
  React.useEffect(function () {
71
- editor.commands.setContent(props.value, true, { preserveWhitespace: "full" });
71
+ // Only replace content if it actually differs from what's in the editor.
72
+ // This avoids resetting the cursor when the editor's own changes round-trip
73
+ // back through props.
74
+ if (editor.getHTML() !== props.value) {
75
+ editor.commands.setContent(props.value, true, { preserveWhitespace: "full" });
76
+ }
72
77
  }, [props.value]);
73
78
  // Upon creation, an editor's contentEditable div is added to the
74
79
  // EditorRegistry.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.315",
3
+ "version": "1.0.317",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",