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

Legacy compat regression: transitive widget getEl and events #1219

Closed
mlrawlings opened this issue Jan 4, 2019 · 0 comments
Closed

Legacy compat regression: transitive widget getEl and events #1219

mlrawlings opened this issue Jan 4, 2019 · 0 comments
Labels
has failing test Repo has a failing test case. Make it pass!

Comments

@mlrawlings
Copy link
Member

Marko Version: 4.14.14

Details

In Marko 3 (and therefore the legacy compat layer in Marko 4) a template without a w-bind could define w-id and be included in a widget that could then getEl that id. Similarly, a template without a w-bind could specify a w-on event handler that points to function in a widget bound in another template that includes the current one.

Expected Behavior

This behavior should continue to work in the legacy compat layer.

Actual Behavior

It no longer works.

Possible Fix

The legacy layer has a getWidgetFromOut helper that used to be triggered by w- attributes in a template without a w-bind. Because these attributes now get transformed to their modern equivalent in the migration stage, this heuristic is no longer there to trigger the behavior. Some possible fixes:

  1. Leave something in place to trigger this behavior
  2. Embed the included template where it is used
  3. Emit events and listen for events where the template is included & use getComponent().getEl() from the parent component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has failing test Repo has a failing test case. Make it pass!
Projects
None yet
Development

No branches or pull requests

1 participant