Skip to content

Slot Changes Re-Rendered in Wrong Location on IE11/Edge #2004

Closed

Description

@umdjm

Stencil version:

I'm submitting a:
[ X] bug report
[ ] feature request
[ ] support request

Current behavior:
Adding child element to a slot on IE11 or Edge displays below template.

Expected behavior:
Element displays adjacent to original slot content.

Steps to reproduce:
Open https://umdjm.github.io/StencilFallbackDemo/ on IE11
Code https://github.com/umdjm/StencilFallbackDemo

Related code:

  render() {
    return <div>
      HEADER
      <br/>
      SLOT GOES HERE (
        <slot />
      )
      <br/>
      FOOTER
    </div>;
  }
    <my-component>
      <p> Initial Slot Data </p>
    </my-component>

Other information:

IE Screenshot

IE Screenshot

Chrome Screenshot

Chrome Screenshot

Activity

  1. umdjm commented on Nov 12, 2019

    @umdjm
    Author

    When I change vdom-render to not reset checkSlotRelocate, I can get this to work on IE with a MutationObserver in my component.

    export class MyComponent {
      observer!: MutationObserver;
      connectedCallback() {
        this.observer = new MutationObserver(this.handleChildrenChange);
        this.observer.observe(this.host, { childList: true });
      }
    
      @Element() host: HTMLElement;
      handleChildrenChange = () => {
        (this.host as any).forceUpdate();
      };
    

    This does not seem like the right fix, but maybe this can help point others to a better fix?

  2. dutscher commented on Nov 12, 2019

    @dutscher

    it seems tobe related to #1968
    cheers

  3. umdjm commented on Nov 12, 2019

    @umdjm
    Author

    Nice - thanks @dutscher. Did you also see #1197 which had a commit yesterday: 5ea2a48

  4. dutscher commented on Nov 15, 2019

    @dutscher

    @umdjm i updated the repo to 1.8.0 and the rerender bug still exists.
    see here https://dutscher.github.io/stencilslots/

    cheers

  5. umdjm commented on Nov 15, 2019

    @umdjm
    Author

    This is fixed for me in v1.8.0 (thanks to #1197).

    I still have to add a MutationObvserver as mentioned in #2004 (comment).

    I'm having other issues with React using IE11 Stencil Components, but I'll try to create a tight repro and open that separately.

  6. umdjm commented on Nov 15, 2019

    @umdjm
    Author

    FYI - @dutscher is still having issues with parent and child re-renders but my simpler use case looks fixed.

  7. umdjm commented on Nov 15, 2019

    @umdjm
    Author

    Opened #2012 to track the React issue mentioned in #2004 (comment)

  8. added
    deprecated_browser_support
    on Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecated_browser_supportslot-related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions