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

Value changes toundefined doesn't work on Baidu template #179

Closed
1 of 6 tasks
malash opened this issue Nov 24, 2022 · 1 comment
Closed
1 of 6 tasks

Value changes toundefined doesn't work on Baidu template #179

malash opened this issue Nov 24, 2022 · 1 comment

Comments

@malash
Copy link
Collaborator

malash commented Nov 24, 2022

Description

For data in template <template is="temp" data="{{{ ...obj }}}" />, when value in obj changes from non-undefined to undefined, it doesn't work unless you specify its field like <template is="temp" data="{{{ ...obj, value: obj.value }}}" />.

Reproduct link

swanide://fragment/c44d02fd72c5c1f011dccf3f91ef089e1669272840476

Reproduct steps

Open the link on Baidu dev tool, and click the button on page to see UI changes.

Impact

Some fields may fails to update during page rerendering.

Screen.Recording.2022-11-24.at.14.57.12.mp4

Temporary solution

We have to specify the field manually.

const children = fixBaiduTemplateBug
? t`<template is="$$GOJI_COMPONENT0" data="{{ ...item, sid: item.sid }}" />`
: t`<template is="$$GOJI_COMPONENT0" data="{{ ...item }}" />`;

Platforms

  • WeChat
  • Baidu ( including Xiaohongshu )
  • QQ
  • Alipay
  • Toutiao
  • KuaiApp
@malash
Copy link
Collaborator Author

malash commented Nov 25, 2022

#180 Introduced a new variable meta to store all data that an elment needed, and this issue was passed by.

@malash malash closed this as completed Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant