diff --git a/components/adv-post-form.js b/components/adv-post-form.js
index 51ade562..d73a2885 100644
--- a/components/adv-post-form.js
+++ b/components/adv-post-form.js
@@ -269,7 +269,7 @@ export default function AdvPostForm ({ children, item, sub, storageKeyPrefix })
emptyItem={EMPTY_FORWARD}
hint={Forward sats to up to 5 other stackers. Any remaining sats go to you. }
>
- {({ index, placeholder }) => {
+ {({ index, AppendColumn }) => {
return (
%}
groupClassName={`${styles.percent} mb-0`}
+ AppendColumn={AppendColumn}
/>
)
diff --git a/components/form.js b/components/form.js
index 852c24f8..1d9e150d 100644
--- a/components/form.js
+++ b/components/form.js
@@ -609,7 +609,7 @@ function FormGroup ({ className, label, children }) {
function InputInner ({
prepend, append, hint, warn, showValid, onChange, onBlur, overrideValue, appendValue,
innerRef, noForm, clear, onKeyDown, inputGroupClassName, debounce: debounceTime, maxLength, hideError,
- ...props
+ AppendColumn, ...props
}) {
const [field, meta, helpers] = noForm ? [{}, {}, {}] : useField(props)
const formik = noForm ? null : useFormikContext()
@@ -687,38 +687,43 @@ function InputInner ({
return (
<>
-
- {prepend}
-
- {(isClient && clear && field.value && !props.readOnly) &&
- {
- helpers.setValue('')
- if (storageKey) {
- window.localStorage.removeItem(storageKey)
- }
- if (onChange) {
- onChange(formik, { target: { value: '' } })
- }
- }}
- className={`${styles.clearButton} ${styles.appendButton} ${invalid ? styles.isInvalid : ''}`}
- >
- }
- {append}
-
- {meta.touched && meta.error}
-
-
+
+
+
+ {prepend}
+
+ {(isClient && clear && field.value && !props.readOnly) &&
+ {
+ helpers.setValue('')
+ if (storageKey) {
+ window.localStorage.removeItem(storageKey)
+ }
+ if (onChange) {
+ onChange(formik, { target: { value: '' } })
+ }
+ }}
+ className={`${styles.clearButton} ${styles.appendButton} ${invalid ? styles.isInvalid : ''}`}
+ >
+ }
+ {append}
+
+ {meta.touched && meta.error}
+
+
+
+ {AppendColumn && }
+
{hint && (
{hint}
@@ -952,31 +957,38 @@ export function VariableInput ({ label, groupClassName, name, hint, max, min, re
{({ form, ...fieldArrayHelpers }) => {
const options = form.values[name]
+
return (
<>
- {options?.map((_, i) => (
-
-
-
- {children
- ? children({ index: i, readOnly: i < readOnlyLen, placeholder: i >= min ? 'optional' : undefined })
- : = min ? 'optional' : undefined} />}
-
-
- {options.length - 1 === i && options.length !== max
- ? fieldArrayHelpers.push(emptyItem)} />
- // filler div for col alignment across rows
- :
}
-
- {options.length - 1 === i &&
- <>
- {hint && {hint} }
- {form.touched[name] && typeof form.errors[name] === 'string' &&
- {form.errors[name]}
}
- >}
-
-
- ))}
+ {options?.map((_, i) => {
+ const AppendColumn = ({ className }) => (
+
+ {options.length - 1 === i && options.length !== max
+ // onMouseDown is used to prevent the blur event on text inputs from overriding the click event
+ ? fieldArrayHelpers.push(emptyItem)} />
+ // filler div for col alignment across rows
+ :
}
+
+ )
+ return (
+
+
+
+ {children
+ ? children({ index: i, readOnly: i < readOnlyLen, placeholder: i >= min ? 'optional' : undefined, AppendColumn })
+ : = min ? 'optional' : undefined} AppendColumn={AppendColumn} />}
+
+
+ {options.length - 1 === i &&
+ <>
+ {hint && {hint} }
+ {form.touched[name] && typeof form.errors[name] === 'string' &&
+ {form.errors[name]}
}
+ >}
+
+
+ )
+ })}
>
)
}}