Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM events not handled by client-only components #1799

Open
vwong opened this issue May 16, 2022 · 0 comments
Open

DOM events not handled by client-only components #1799

vwong opened this issue May 16, 2022 · 0 comments
Labels
type:unverified bug A bug report that has not been verified

Comments

@vwong
Copy link
Contributor

vwong commented May 16, 2022

Marko Version: 5.21.1

Details

Emitted DOM event not handled by client-only component (denoted by component-browser.js), but are caught by normal component (denoted by component.js)

// app-button.marko
<button on-click("emit", "click")>
  <${input.renderBody}/>
</button>

// broken.marko
<app-button on-click("handleIt")>
  broken
</app-button>

// broken.component-browser.js
export default class {
  handleIt () {
    alert("nah") // expect this to fail
  }
}

// working.marko
<app-button on-click("handleIt")>
  working
</app-button>

// working.component.js
export default class {
  handleIt () {
    alert("yeah") // expect this to work
  }
}

Expected Behavior

It should not matter how the parents are split, the click handler should continue to work.

Actual Behavior

In the above <working /> creates a button that when clicked, generates the alert "yeah", but </broken> has similar looking code, but is in a component-browser.js file, doesn't work.

Your Environment

Node: 16.13.2, Mac OS 12.3.1, Chrome 101, Firefox 99, Firefox 100.

@vwong vwong added the type:unverified bug A bug report that has not been verified label May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:unverified bug A bug report that has not been verified
Projects
None yet
Development

No branches or pull requests

1 participant