Skip to content
This repository was archived by the owner on Oct 12, 2020. It is now read-only.

check interaction with render modifiers #203

@lifeart

Description

@lifeart

// background - emberjs/ember.js#18698 (comment)
https://github.com/lifeart/ember-ref-modifier/blob/master/tests/dummy/app/components/glimmer-ref.js

since we setting property in next runloop, such code may fail

 <div {{ref this "menuElement"}} {{did-insert this.focusOnFirstItem}} >

in other side, callback may solve issue

<div {{ref this.setMenuElement}} >
<div {{did-insert this.setMenuElement}} >
@action
setMenuElement(node) {
  this.menuElement  = node;
  this.focusOnFirstItem(node);
}

in other way, we can make next runloop sheduling optional, or remove it at all from modifier itself and give control to developers.

{{ref this "prop"}} - for classic usage
{{ref this "prop" run="next"}}  - for runloop control
{{ref this.setElement run="next"}} - runloop controlled callback
{{ref (next-runloop this.setElement)}} - manual callback control

other way - allow tracked chain computations rerun in same transaction if some of tracked properties is DOM node, but it seems low-level change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions