8000 Bug in use_drop with nested target · Issue #35 · jetli/yew-hooks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Bug in use_drop with nested target #35
Open
@ctron

Description

@ctron

I need to create a reproducer, but I think there is a bug in the use_drop when the ref is placed in a nested context:

#[function_component(Other)]
fn other(props: &ChildrenProps) -> Html {
  html!(<div> { for props.children.iter() } </div>)
}

#[function_component(Example)]
fn example() -> Html {
  let node = use_node_ref();
  let drop = use_drop(node.clone());

  html!(
    <div ref={node}> // works when it's here
      <Other>
        <div ref={node}> // but not when it's here
        </div>
      </Other>
    </div>
  )
}

Through the browser's DOM inspector, I can see the events being attached when putting the ref on the other one, but not when it's in the inner one.

< 4399 /div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0