Skip to content

adding element in a <slot /> is not added into the slot #810

Closed

Description

@stevenao

Stencil version:

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:
new elements are added outside of the slot:

input a
input b
input c
input (new date isoString)

Expected behavior:

input a
input b
input c
input (new date isoString)

Steps to reproduce:

Related code:

@Component({
  tag: 'my-slot-component',
})
export class MySlotComponent {
render() {
    return ( <div> <slot /> </div>);
}
}

@Component({
  tag: 'my-list',
  shadow: true
})
export class MyList {
  handleInputEvent(event: UIEvent) {
    this.items = [...this.items, new Date().toISOString()];
  }
  @Prop() id: string;
  @Prop({ mutable: true }) items: Array<string> = ['a', 'b', 'c'];
  render() {
    return (
      <my-slot-component>
          {this.items.map((item) =>
            <div>== <input type="text" value={item} onDblClick={(event: UIEvent) => this.handleInputEvent(event)} /></div>
          )}
      </my-slot-component>
    );
  }
}

Other information:

Activity

  1. changed the title [-]adding element in slot is not added inside slot[/-] [+]adding element in a <slot /> is not added into the slot[/+] on May 16, 2018
  2. adamdbradley commented on May 21, 2018

    @adamdbradley
    Contributor

    Thanks for the issue! This should be fixed from: 9a36b0c

    Also added your tests here: 2a1553f

    Thanks!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions