-
Notifications
You must be signed in to change notification settings - Fork 322
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
docs: fix withLiveEdit
s sticky section behaviour for actions
#2546
docs: fix withLiveEdit
s sticky section behaviour for actions
#2546
Conversation
Hey @malavshah9, I'm sorry if the issue wasn't clear enough, I meant it should always be visible and stick on the right bottom side. From the very beginning and even when scrolled (middle or bottom of scroll) |
@YossiSaadi Updated PR with sticky behavior. Thanks! |
withLiveEdit
s sticky section behaviour for actions
withLiveEdit
s sticky section behaviour for actionswithLiveEdit
s sticky section behaviour for actions
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.
Amazing @malavshah9, very elegant solution!
I had a few comments :)
- I think the
max-height
trick forcm-editor
, alongside theposition: relative
, should get the job done, without renderingchildren
forLiveEditor
- And maybe even the
position: relative
can also be removed!
mind making sure? :)
@@ -18,7 +18,8 @@ | |||
} | |||
|
|||
& :global(.cm-editor) { | |||
padding: var(--sb-spacing-medium); | |||
padding: 0 0 0 var(--sb-spacing-medium); |
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.
can you please change that one to
padding: 0 0 0 var(--sb-spacing-medium); | |
padding: var(--sb-spacing-medium); | |
padding-right: 0; |
we want the rest of the padding, only the right padding is now an issue (because of the scrollbar)
@@ -18,7 +18,8 @@ | |||
} | |||
|
|||
& :global(.cm-editor) { | |||
padding: var(--sb-spacing-medium); | |||
padding: 0 0 0 var(--sb-spacing-medium); | |||
max-height: 500px; |
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.
nice 💯
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 think we can give up on those changes
The actions can be rendered as a sibling and it should still work I believe
@@ -6,4 +6,5 @@ | |||
right: 0; | |||
border-top-left-radius: 4px; | |||
overflow: hidden; | |||
z-index: 1; |
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.
If we don't insert the LiveEditor changes for actionComp, this also might be redundant, as the actions would be after the cm-editor in the DOM
actionComp={ | ||
<> | ||
<section className={styles.actions}> | ||
<LiveEditorAction onClick={onCopyClick} disabled={isCopied}> | ||
{isCopied ? "Copied" : "Copy"} | ||
</LiveEditorAction> | ||
<LiveEditorAction onClick={onFormatClick}>Format</LiveEditorAction> | ||
<LiveEditorAction onClick={onResetClick}>Reset</LiveEditorAction> | ||
</section> | ||
</> | ||
} |
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.
can you restore this one to be a sibling rather than as a prop for LiveEditor?
<section className={styles.actions}> | ||
<LiveEditorAction onClick={onCopyClick} disabled={isCopied}> | ||
{isCopied ? "Copied" : "Copy"} | ||
</LiveEditorAction> | ||
<LiveEditorAction onClick={onFormatClick}>Format</LiveEditorAction> | ||
<LiveEditorAction onClick={onResetClick}>Reset</LiveEditorAction> | ||
</section> |
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.
to this one
@YossiSaadi All required changes are done from my side, you can re-review now. |
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.
Amazing work @malavshah9, thanks for your contribution to Vibe!!
Resolves #2513