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
Divider with note is overlapping #8444
Comments
Seems like this is caused by the negative margin bottom here:
which was added in #7972. @benhaynes I believe this is added to make the gap between presentation divider and input smaller right? Would like to get your thoughts on this before I do any abrupt change here. |
That's correct! The divider was evenly spaced between the fields above and below. These new margins helped keep the divider closer to the section it was labeling... But unfortunately also his making the note too close. Any ideas? 🤔 |
@benhaynes Would this be okay? Removed the negative Also, the
Lastly, which section close to labeling did you mean? Any example? Title + NoteTitle + Note + Increase Margin TopTitleTitle + Increase Margin TopNoteNote + Increase Margin TopEmptyEmpty + Increase Margin Top |
@licitdev — this is super helpful, thank you!! These options offer good customization, my main concern was that the normal/default state places the divider equally between form sections: In this example, the divider is the same distance to the green button (above) as to the gray button (below). My design mind wants the divider always closer to the form section it is labeling (the part with the gray button). I know the "Margin Top" adds this, but I think that should be the default. @rijkvanzanten ? Also, I decreased the form-gap-vertical a week ago, and that is helping here. |
Yeah i'm down to change the default value of that margin option to true, or just have it hardcoded enabled at all time (not sure why that needs to be configurable) |
@rijkvanzanten The add top margin already defaults to |
I think the only reason to make the margin-top configurable is in case it's at the top of the form (so it doesn't just push everything down for no reason). If that is resolved somehow, I would love to ditch this option and just hard-code it! |
That should be doable with some css selection magic 👍🏻 |
Yup that margin-top can be toggled now. We only have to remove @benhaynes I would like to ask if you would still like to have the I had removed it to make it exactly vertically middle for the
|
@licitdev @benhaynes we can't rely on negative margins for things like these, because it will always result in issues when used in a different context (as proven by this issue's existence) 👍🏻 |
@rijkvanzanten Yup definitely. I just let the existing negative margin remain there as I don't wish to break the uniformity of UI. 😂👍🏻 |
OK, cool. So let's hardcode the interface to ALWAYS have the top margin, and remove the option altogether. 👍 |
@benhaynes Do you mean to remove the The below screenshot shows the default options, whereby the additional margin top is set to TRUE. The option to toggle is very helpful particularly if the divider contains no title and is just used as a line separator. |
Hmm, good point. What if we ALWAYS had the top margin when there is a Title, but NEVER have it if there is no title? Also, not sure if I like the styling of the "Inline Title" option. |
Yes that should be possible, the divider will also need to have the top margin removed if it happens to be the first field. I have tried to mess around with the CSS such as :first-child and parent selector etc, but couldn't get it working... |
I think we should get rid of the "Margin Top" option completely, in favor of just doing it correctly by default 👍🏻 |
I can pick this up 🙂 Do you wanna prepare a PR and I'll add this in on top of that? |
I think that's where Ben's suggestion comes in: Only add the top margin when a Title has been configured 🙂 |
Ah... Means if without a title, it'll be without the
Yup, working on it~ |
Preflight Checklist
Describe the Bug
When setting up a divider in a collection and adding a Note for it, the note does not add an offset from the divider itself, making it sticked to the line, which isn't consistent with the rest of the UI.
To Reproduce
Create a presentation field of type Divider and add a note. Go to the collection and observe the result
What version of Directus are you using?
rc.95
What version of Node.js are you using?
What database are you using?
What browser are you using?
Chrome
What operating system are you using?
How are you deploying Directus?
The text was updated successfully, but these errors were encountered: