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

Make placeholder block optional #76

Closed
julianrubisch opened this issue Jan 31, 2021 · 6 comments · Fixed by #103
Closed

Make placeholder block optional #76

julianrubisch opened this issue Jan 31, 2021 · 6 comments · Fixed by #103
Milestone

Comments

@julianrubisch
Copy link
Contributor

Feature Request

Describe the solution you'd like

sometimes you don't want a placeholder at all for a given element, so ideally a block would not be required as a placeholder.

@julianrubisch
Copy link
Contributor Author

I'm starting to wonder if that's maybe a special case for eager: true

I think it could be sufficient to make the placeholder optional when eager is true

@rickychilcott
Copy link
Contributor

My intended use case is for rendering actions or buttons that are dependant on a users permission levels. hacked together example is at https://sleepy-sea-13861.herokuapp.com/?showAll=true

In my case, I really don't want a spinner or anything to indicate that it's loading, but the button can pop in when it's returned from the server. I think you're right that I may make it eager: true, but I guess I'm failing to see why it's required at all.

@julianrubisch
Copy link
Contributor Author

Why what is required? The placeholder?

Because something needs to trigger the intersectionobserver. But eager: true short circuits that anyway, so maybe we can make the placeholder optional if eager is true?

@rickychilcott
Copy link
Contributor

Yeah, I think I understand the technical reasons why a placeholder is needed, but what I don't understand is why it needs to be user-provided.

Can the placeholder default to something like tag.div or tag.span if a placeholder is not provided? I know we need an element on the page to trigger intersectionobserver, but does an empty element work?

@julianrubisch
Copy link
Contributor Author

Ah I see! Well yes and no, it can be a default but it needs to be actually visible.

@julianrubisch
Copy link
Contributor Author

Maybe we could make everything a bit simpler and say, if no placeholder, make it an eager element.

Could deprecate eager in the future...

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 a pull request may close this issue.

2 participants