Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tylershuster
Copy link
Contributor

@tylershuster tylershuster commented Nov 22, 2020

Fixes #3824

...or nearly does. There's a problem where when you've entered a ship, then you go to type in another one, it clears the current value (preventing you from selecting multiple). @liam-fitzgerald you know react hooks & formik better than I. Can you point out what I'm doing wrong in ShipSearch.tsx?

A hint: in onChange, value is set to a blank array when it fires for the first time after selecting a ship, although the component later on knows that there is something in value.

@liam-fitzgerald
Copy link
Contributor

hope you don't mind me pushing over it. tl;dr is that the lack of separation between the textfield state and the selected state made things a little awkward. Refactored to store them separately and useEffect to set the actual field value any time either one changes.

@liam-fitzgerald
Copy link
Contributor

cc: @tylershuster can you review my changes?

@tylershuster
Copy link
Contributor Author

Sure...Where are they?

@liam-fitzgerald
Copy link
Contributor

oh lol i can't push to your repo
https://github.com/urbit/urbit/tree/invite-modal-submit

@matildepark
Copy link
Contributor

matildepark commented Nov 25, 2020 via email

@tylershuster
Copy link
Contributor Author

Reference:

3a3a1ac

@liam-fitzgerald
Copy link
Contributor

@tylershuster could you cherrypick the changes onto your branch?

@tylershuster
Copy link
Contributor Author

Yeah, this looks good. Like I said, I'm not too great with hooks yet so I'll study this as part of my education, but it does the job proper

@tylershuster tylershuster marked this pull request as ready for review November 25, 2020 04:38
@matildepark
Copy link
Contributor

This disabled state needs a tweak —

image

I think if you pass backgroundColor='white' to AsyncButton -> Button you can force disabled state to always blend in here?

@tylershuster
Copy link
Contributor Author

How do we indicate it's disabled? If I pass bg="white" then it doesn't change when it becomes valid

@matildepark
Copy link
Contributor

All we care about is preventing the click. This popover doesn't use buttons like other UI prompts; it's really a button pretending to be an Action in this case. @urcades

@urcades
Copy link
Contributor

urcades commented Nov 25, 2020

For reference, the latest "New DM" modal appears as such:

Screen Shot 2020-11-25 at 5 22 37 PM

@g-a-v-i-n should probably confirm here if Affirmative Buttons are universally aligned to the right side of the modal, or only right-aligned when another option is presented, ie [cancel] [send]

@matildepark
Copy link
Contributor

Every time lol

@urcades
Copy link
Contributor

urcades commented Nov 25, 2020

Also: It's not necessary to pay mind to this entire design, but I've pasted this here because it is the latest art and depicts the state of the inactive indigo button.

@tylershuster
Copy link
Contributor Author

Ok, given the larger changes that need to be applied for the above design to work, how would we feel about shipping this for now?

image

image

@urcades
Copy link
Contributor

urcades commented Nov 25, 2020

Yeah, this button state is good, stamp

@matildepark
Copy link
Contributor

Lightning round! How do we fix the error validation being rude when we're trying to choose an option?

Nov-25-2020 17-53-26

Also can we make the text use cursor: pointer for the candidates too

@tylershuster
Copy link
Contributor Author

@liam-fitzgerald this is related to validateOnBlur...any ideas?

@matildepark
Copy link
Contributor

If the button disables anyway, why does it need the onBlur validation as well?

@liam-fitzgerald
Copy link
Contributor

just drop setTouched(true) in the onBlur handler, it'll behaviour fine because touched is set to true in the onSelect handler anyway.

@tylershuster
Copy link
Contributor Author

Ready for review

@matildepark
Copy link
Contributor

It's on the list for today ...

@matildepark
Copy link
Contributor

Can you revise the commits?

@tylershuster
Copy link
Contributor Author

yes

);

const onBlur = useCallback(() => {
setInputTouched(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

is this still correct? i thought setTouched needs to be here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh it needed to be dropped, okay.

@matildepark matildepark merged commit 96c2221 into urbit:release/next-userspace Nov 30, 2020
@tylershuster tylershuster deleted the invite-modal-submit branch January 6, 2021 22:47
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.

4 participants