Skip to content

Widget does not initialize with correct width #6

@SIRHAMY

Description

@SIRHAMY

Overview

I'm embedding the widget in my Svelte site. The widget seems to initially be the correct size then it re-renders to the incorrect size (thinks it's fullscreen but not).

It will then re-size to the correct size if I manually resize my screen but otherwise is incorrect.

What I expect to happen

  • Widget should be able to inherit the correct width from whatever div it gets loaded into

What actually happens

  • Widget seems to load in with incorrect size -> I can track this down to size="hide"
  • If I resize the screen then it will change itself to size="sm" which seems to fix the problem

Repro

How to repro:

You can also repro in svelte repl:

Code:

<div style="width: 440px">
	<script src="https://climateclock.world/widget-v2.js" async></script>
		<climate-clock />
</div>

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions