-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix(homepage): placeholder inputs #1451
Conversation
<div className={editorStyles["bp-dropdown-item"]}> | ||
<h5>{title}</h5> | ||
<h5>{title || DROPDOWN_ELEMENT_SECTION.title}</h5> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we pass in hero section this way instead of like the other preview sections? (destructuring existing object so that only non-blank params will overwrite)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't the other preview adopt this pattern also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh cos this way was less work - i'm open to keeping it consistent tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is abit annoying to do here cos we have to do a type cast + overwrite a child array. lmk if this is a blocker for u
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with leaving it as is if it's annoying to implement!
d868e2b
to
0a7abe7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @seaerchin for addressing the comments quickly
6792d9d
to
84a83e6
Compare
Problem
Previously, we always prefilled sections on initial add - this allows people to slip up and accidentally click save even when it was the default values.
Closes IS-500
Solution
length < 0
, which will never be true.hasError
from theformState
- this is required because errors are only set on change. this means that, for example, users can add an empty block and save instantly (as no change was made), which runs counter to what we want.onBlur = onChange
. as the value is controlled by us and there's no value change on blur, this only serves to retrigger validation on blur events so that we inform the user about what failed validation (empty input on initial create for eg)Tests
Notes
Feels like we're reinventing the wheel here already. i don't want to put more effort into this but our validation strategy feels abit off as closing the accordion, for example, does not trigger validation.
maybe can consider shifting to a form lib that does this for us but is a significant effort so i think we should just live with this as an intermediate measure until we decide that we want to nudge website builders in the right dir
@sehyunidaaa - maybe we can prompt the
isOptional
already otherwise feels like users might grapple with this