GithubHelp home page GithubHelp logo

halogen-portal-bug's Introduction

The Bug

Not sure if this is a Halogen bug or a bug in the portal. It's very weird.

In this example we have a modal component with a close button. The close action is raised up from the modal and handled by the parent component, which sets some state to false, causing the portal to be removed.

  1. When the parent component emits the action, it is handled correctly and the portalled HTML is removed from the DOM
  2. When the child component emits the action, although the parent handles it ands sets the state, the portalled HTML is not removed from the DOM

In the finaliser for the portal component, the call to H.get never binds in the latter case. You can see in the console that the finaliser is called, as Finalising portal is logged, however the state returned from H.get is never logged.

The component is then in a broken state. It appears to no longer be running (as handleAction isn't called), but the subscription which writes those messages to var is still active.

Setup instructions

Uses pnpm but swap for another manager if you want, shouldn't matter.

  1. spago build
  2. pnpm install
  3. pnpm dev
  4. Go to localhost:5173
  5. Notice that clicking the close button within the parent component works as expected, but the child one does not.

halogen-portal-bug's People

Contributors

noisyscanner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.