-
Notifications
You must be signed in to change notification settings - Fork 11
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
item-changed firing twice in repeatitem #235
Labels
bug
Something isn't working
Comments
I don't know, whether my observations will help you to improve fx-repeat:
setup from fore-exist, but fore-dev is latest dev
|
Thanks for this detailed report. That's something we can work with.
Regarding case one: it shoulf of course just fire once. We'll fix that.
Case 2: this is a result of everything being cloned n-times so we end up
with n handlers here. It should however only fire on the active repeatitem.
We were already working on these issues.
Case 3: was actually never intended to work ;) but docs are not clear here
i guess. And - why not? I tend to make it work rather than to restrict it
too much but we'll need to look into it.
Might take some time - holiday season :)
Thanks again - very helpful report.
Peter Herkenrath ***@***.***> schrieb am So., 4. Aug. 2024,
14:40:
… I don't know, whether my observations will help you to improve fx-repeat:
- if the highlighted item is clicked, the 'item-changed' event will
fire too.
- if the fx-message tag is placed within the template tag, it will
fire multiple times (no. of fx-repeatitem elements)
- the pathologic cases:
-- if the fx-message tag is placed within the repeat but outside the
template, it is only fired once (message and repeat-index correct)
-- fx-message with fx-action produces an additional strange
interaction, if placed outside the template tag: the message is correct but
the repeat-index attribute is offset by the number of additional nodes
outside template (my guess)
setup from fore-exist, but fore-dev is latest dev
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes" name="viewport"/>
<title>repeat test</title>
<link href="../resources/css/fore.css" rel="stylesheet"/>
<style>
[repeat-index] {
background-color : yellow;
}
</style>
</head>
<body>
<fx-fore>
<fx-model>
<fx-message event="model-construct-done">event model ready</fx-message>
<fx-instance>
<data>
<sub value="result1"/>
<sub value="result2"/>
<sub value="result3"/>
<sub value="result4"/>
<sub value="result5"/>
<sub value="result6"/>
</data>
</fx-instance>
</fx-model>
<fx-repeat id="r-sub" ref="sub">
<!--
<fx-message event="item-changed" target="r-sub">Index Changed(1): {event('index')}</fx-message>
<fx-action event="item-changed" target="r-sub">
<fx-message>Index changed(2): {event('index')}</fx-message>
</fx-action>
<fx-action event="item-changed" target="r-sub">
<fx-message>Index changed(3): {event('index')}</fx-message>
</fx-action>
-->
<template>
<fx-message event="item-changed" target="r-sub">Index Changed(4): {event('index')}</fx-message>
<fx-output ***@***.***"/>
</template>
</fx-repeat>
</fx-fore>
<script type="module" src="../resources/script/fore-dev.js"/>
</body>
</html>
—
Reply to this email directly, view it on GitHub
<#235 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADWFW5RIRQCVS7TNY6AWRDZPYOLLAVCNFSM6AAAAABL6Z2SF2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGUZDSMZTHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Took a look at this, and I have some observations:
I made a PR fixing the spammy item-changed events! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
adding a
<fx-message event="item-changed" target="r-task">Index Changed {event('index')}</fx-message>
to todo2.html example shows the event firing twice instead of once.
The text was updated successfully, but these errors were encountered: