Skip to content
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

Add Sticky component #6677

Merged

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Jun 30, 2022

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets fixes #
Related issues/PRs #6676, #6669
License MIT
Documentation PR sulu/sulu-docs#

What's in this PR?

Add a sticky component which childs allow to behave different between stick state.

Why?

This will be required for the BlockToolbar.

Example Usage

<Sticky>{
    (isSticky) => <span>{isSticky ? 'Stick' : 'Unsticky'}</span>
}</Sticky>

sticky

To Do

  • Create a documentation PR

.sticky {
position: sticky;
top: 0;
z-index: 1; /* push element in front of position: relative elements */
Copy link
Member Author

Choose a reason for hiding this comment

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

Else position relative elements are above the sticky toolbar:

position-sticky-issue

https://jsfiddle.net/oey4dq1x/

Copy link
Contributor

Choose a reason for hiding this comment

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

😱

Copy link
Contributor

Choose a reason for hiding this comment

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

this will probably push the sticky element above our overlays/dialogs too 😕 i think we can prevent that from happening by setting z-index: 0 in the parent component that uses this component, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

unfortunately, i think there is no way around this problem while keeping the needed functionality, so i am going to merge this 🙂

@niklasnatter niklasnatter merged commit 62b24de into sulu:2.5 Jul 1, 2022
@alexander-schranz alexander-schranz deleted the feature/add-sticky-component branch July 1, 2022 12:27
@alexander-schranz alexander-schranz added the Feature New functionality not yet included in Sulu label Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New functionality not yet included in Sulu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants