diff --git a/src/components/Forms/InlineValuePopover.jsx b/src/components/Forms/InlineValuePopover.jsx index 90241b270..af912e4c1 100644 --- a/src/components/Forms/InlineValuePopover.jsx +++ b/src/components/Forms/InlineValuePopover.jsx @@ -8,6 +8,7 @@ export const InlineValuePopover = ({ text, isOpen = false, showArrow = true, + autoSelectOnClick = false, onClick, onClickOutside, classNames, @@ -20,7 +21,14 @@ export const InlineValuePopover = ({ setTimeout(() => { // This may technically belong in Seller app, but the most common use case for this component here is // to use inputs, so we'll provide some helpers for that - ref?.current.querySelector("select,textarea,input")?.focus(); + const popoverInput = ref?.current.querySelector("select,textarea,input"); + if (!popoverInput) return; + + popoverInput.focus(); + + if (autoSelectOnClick) { + popoverInput.select(); + } }, 0); onClick?.(e); };