semperai / effectiveacceleration.ai

https://effectiveacceleration-ai.vercel.app
0 stars 1 forks source link

perform proper validation during update job details #38

Closed kasumi-1 closed 1 day ago

kasumi-1 commented 3 days ago

all fields should be properly validated like on create job page

jojedev commented 2 days ago

This turned out to be a bigger task. I managed to add succesfully the validations, also I needed to add extra inputs because we need the user to be able to specify a maxjobTime using units, also with categories and tags (because we're using mece tags). After I added everything, I noticed that the listboxes weren't working. I spent some time debugging it and came to the conclusion that the problem comes from the headlessUI library. Basically when you use the Dialog from the headlessUI AND the listbox from headlessUI simultaneously, the html from the listbox breaks, and it doesn't allow you to hover other items or select anything.

Tried to fix it, but it is really mesed up. What I'm seeing is the dom is a component completely different. I assume this happens because both dialog and listbox components has similar properties

Possible solutions:

  1. Fix it using https://github.com/tailwindlabs/headlessui/issues/1420#issuecomment-1120449399
  2. Use another Dialog for this component (UpdateButton.tsx).
  3. Use another Listbox and stylize it properly. I'll keep working on this

image

image

jojedev commented 1 day ago

At the end the neccesary solution was to use the "Select" headlessUI component. I created a new reusable component that looks the same as the rest, the dropdown isn't the same of the postJob but I think its fair enough for our Dialog editjob post.

image image

https://github.com/semperai/effectiveacceleration.ai/commit/9ff50bd9979481a16982d08294b1a437b5353e70