Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ListboxInput component for selecting multiple options and use it for barbuddies #562

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ARBaart
Copy link
Contributor

@ARBaart ARBaart commented Apr 13, 2024

No description provided.

Copy link

Deploying outsite-nl with  Cloudflare Pages  Cloudflare Pages

Latest commit: b7cc50e
Status: ✅  Deploy successful!
Preview URL: https://abb4a09e.dwhdelft-nl.pages.dev
Branch Preview URL: https://features-multibuddy.dwhdelft-nl.pages.dev

View logs

@@ -12,19 +12,23 @@ const props = defineProps({
barBuddies: { type: Array, required: true },
})

const form = useReMemberForm('barbuddy', {
const form = useReMemberForm('barbuddy2', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, I forgot, why can't we use the old form still?

Since we're just comma seperating the bar buddies I think we could just as well stick them into the original barbuddy property

remarks: '',
})

const formElement = ref(null)
const submit = async () => {
if (form.fields.buddies.length > 0) {
form.fields.buddy_preferences = form.fields.buddies.join(', ')
}
await form.submit()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await form.submit()
await form.submit({
buddy_preferences: form.fields.buddies.join(', ') || 'no_preference'
})

I'd do something like this and remove the previous 3 lines + the property on line 22

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, still surprised this works, awesome

Comment on lines +5 to +7
ListboxLabel,
ListboxButton,
ListboxOptions,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are unused

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and the ref import as well)

Base automatically changed from nuxt3-rewrite to main August 18, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants