@plastic-js/tsumiki 0.1.88 → 0.1.89

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.
@@ -188,10 +188,18 @@ var Input = (props = {}) => {
188
188
  if (!isPassword) return read(local.type);
189
189
  return showPassword() ? "text" : "password";
190
190
  };
191
+ const isAffixInteractive = (target) => {
192
+ return !!(target && target.closest && target.closest("button, a, input, select, textarea, label, [contenteditable]"));
193
+ };
194
+ const handleAffixMouseDown = (e) => {
195
+ if (effectiveDisabled()) return;
196
+ if (isAffixInteractive(e.target)) return;
197
+ e.preventDefault();
198
+ inputEl?.focus();
199
+ };
191
200
  const handleAffixPointerUp = (e) => {
192
201
  if (effectiveDisabled()) return;
193
- const target = e.target;
194
- if (target && target.closest && target.closest("button, a, input, select, textarea, label, [contenteditable]")) return;
202
+ if (isAffixInteractive(e.target)) return;
195
203
  inputEl?.focus();
196
204
  };
197
205
  const renderAffix = (content) => {
@@ -200,6 +208,7 @@ var Input = (props = {}) => {
200
208
  const _el0 = _tmpl.cloneNode(true);
201
209
  insert(_el0, () => content);
202
210
  setProp(_el0, "className", () => affixClass);
211
+ setProp(_el0, "onMouseDown", () => handleAffixMouseDown);
203
212
  setProp(_el0, "onPointerUp", () => handleAffixPointerUp);
204
213
  return _el0;
205
214
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plastic-js/tsumiki",
3
- "version": "0.1.88",
3
+ "version": "0.1.89",
4
4
  "description": "A UI component library for Plastic JS.",
5
5
  "license": "MIT",
6
6
  "author": "tigre",