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

fix(web): fix webrender listview item relayout #4083

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ module.exports = {
template: path.resolve('./public/index.html'),
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env': {
NODE_ENV: JSON.stringify('development'),
HOST: JSON.stringify(process.env.DEV_HOST || '127.0.0.1'),
PORT: JSON.stringify(process.env.DEV_PORT || 3000),
},
__PLATFORM__: JSON.stringify(platform),
}),
new CaseSensitivePathsPlugin(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default class AnimationExample extends React.Component {
duration: 2000,
delay: 0,
mode: 'timing',
valueType: 'deg',
timingFunction: 'linear',
}),
follow: false, // 配置子动画的执行是否跟随执行
Expand All @@ -165,6 +166,7 @@ export default class AnimationExample extends React.Component {
duration: 2000,
delay: 0,
mode: 'timing',
valueType: 'deg',
timingFunction: 'linear',
}),
follow: true,
Expand All @@ -182,6 +184,7 @@ export default class AnimationExample extends React.Component {
duration: 2000,
delay: 0,
mode: 'timing',
valueType: 'deg',
timingFunction: 'linear',
}),
follow: false, // 配置子动画的执行是否跟随执行
Expand All @@ -193,6 +196,7 @@ export default class AnimationExample extends React.Component {
duration: 2000,
delay: 0,
mode: 'timing',
valueType: 'deg',
timingFunction: 'linear',
}),
follow: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ export class ListViewItem extends HippyWebView<HTMLDivElement> {
public handleReLayout(entries: ResizeObserverEntry[]) {
const [entry] = entries;
const { height } = entry.contentRect;
if ((height === 0 && Math.round(height) !== this.height) || Math.round(height) !== this.dom?.clientHeight) {
if ((Math.round(height) === this.height) && Math.round(height) === this.dom?.clientHeight) {
// no need to relayout ListViewItem when height is not changed
return;
}
this.height = Math.round(height);
Expand Down
Loading