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

Hot Graphic block position not retained when returning to desktop view #280

Open
swashbuck opened this issue Jul 10, 2023 · 0 comments
Open
Labels

Comments

@swashbuck
Copy link
Contributor

swashbuck commented Jul 10, 2023

Subject of the issue

When using the _isNarrativeOnMobile option, the Hot Graphic component will change to a Narrative component on mobile. The problem is that the new Narrative component is always added to the end of the block's contents in the DOM order. This breaks the intended order of any components in the same block.

I believe this is because the Narrative/Hot Graphic is always appended to the block without regard for the original order:

$container.append(newNarrative.$el);

The Narrative's replaceWithHotgraphic() also has the same behavior where the component is appended to the end of the block.

Your environment

  • Hot Graphic 6.7.6
  • Narrative 7.4.9

Steps to reproduce

  1. Add a Hot Graphic component to a block using 'left' for _layout
  2. Add a Graphic (or other) component to the same block using 'right' for _layout
  3. Use _isNarrativeOnMobile: true on the Hot Graphic
  4. View on mobile and notice the Graphic component's position
  5. Then, view on desktop and notice the Graphic component's position

Expected behaviour

The Graphic component should be below the Hot Graphic on mobile and to the right on desktop.

Actual behaviour

It is not so.

Screenshots

Before switching to Mobile
before

After switching to Desktop from Mobile
after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant