diff --git a/app/soapbox/components/ui/hstack/hstack.tsx b/app/soapbox/components/ui/hstack/hstack.tsx
index a109da608..996320dea 100644
--- a/app/soapbox/components/ui/hstack/hstack.tsx
+++ b/app/soapbox/components/ui/hstack/hstack.tsx
@@ -40,6 +40,8 @@ interface IHStack {
space?: keyof typeof spaces
/** Whether to let the flexbox grow. */
grow?: boolean
+ /** HTML element to use for container. */
+ element?: keyof JSX.IntrinsicElements,
/** Extra CSS styles for the
{
- /** Size of the gap between elements. */
- space?: keyof typeof spaces
/** Horizontal alignment of children. */
alignItems?: 'center'
+ /** Extra class names on the element. */
+ className?: string
/** Vertical alignment of children. */
justifyContent?: keyof typeof justifyContentOptions
- /** Extra class names on the
element. */
- className?: string
+ /** Size of the gap between elements. */
+ space?: keyof typeof spaces
/** Whether to let the flexbox grow. */
grow?: boolean
+ /** HTML element to use for container. */
+ element?: keyof JSX.IntrinsicElements,
}
/** Vertical stack of child elements. */
const Stack = React.forwardRef((props, ref: React.LegacyRef | undefined) => {
- const { space, alignItems, justifyContent, className, grow, ...filteredProps } = props;
+ const { space, alignItems, justifyContent, className, grow, element = 'div', ...filteredProps } = props;
+
+ const Elem = element as 'div';
return (
-
({ id, shouldCondense, autoFocus, clickab
setComposeFocused(true);
};
- const handleSubmit = () => {
+ const handleSubmit = (e?: React.FormEvent) => {
if (text !== autosuggestTextareaRef.current?.textarea?.value) {
// Something changed the text inside the textarea (e.g. browser extensions like Grammarly)
// Update the state to match the current text
@@ -142,6 +142,10 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab
// Submit disabled:
const fulltext = [spoilerText, countableText(text)].join('');
+ if (e) {
+ e.preventDefault();
+ }
+
if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxTootChars || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
return;
}
@@ -261,7 +265,7 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab
}
return (
-
+
{scheduledStatusCount > 0 && (
({ id, shouldCondense, autoFocus, clickab