labellife-design-tool 2.4.2 → 2.4.3

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.
@@ -1385,8 +1385,10 @@ var TextElementComponent = mobxReactLite.observer(function (_ref) {
1385
1385
  var cssFontWeight = String(element.fontWeight || 'normal');
1386
1386
  var originalText = element.text;
1387
1387
  var textarea = document.createElement('textarea');
1388
- textarea.value = '';
1389
- textarea.placeholder = originalText;
1388
+ textarea.value = originalText;
1389
+ // Only show the dimmed placeholder hint when there's no real text yet
1390
+ // (e.g. a freshly-added text element) — not when editing existing text.
1391
+ textarea.placeholder = originalText ? '' : element.placeholder;
1390
1392
  textarea.style.position = 'absolute';
1391
1393
  textarea.style.top = "".concat(textPosition.y, "px");
1392
1394
  textarea.style.left = "".concat(textPosition.x, "px");
@@ -1426,12 +1428,14 @@ var TextElementComponent = mobxReactLite.observer(function (_ref) {
1426
1428
  stageContainer.appendChild(placeholderStyle);
1427
1429
  stageContainer.appendChild(textarea);
1428
1430
  textarea.focus();
1431
+ var caretPos = textarea.value.length;
1432
+ textarea.setSelectionRange(caretPos, caretPos);
1429
1433
  var removed = false;
1430
1434
  var removeTextarea = function removeTextarea() {
1431
1435
  var cancel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1432
1436
  if (removed) return;
1433
1437
  removed = true;
1434
- var newText = !cancel && textarea.value.length > 0 ? textarea.value : originalText;
1438
+ var newText = cancel ? originalText : textarea.value;
1435
1439
  element.set({
1436
1440
  text: newText
1437
1441
  });