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: fix assertion error when change display in input element. #505

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

andycall
Copy link
Member

Fix the following assertion error the the examples:

Code

const input = document.querySelector('#input');
document.body.onclick = () => {
   input.style.display = 'inline';
}

ErrorMsg

======== Exception caught by widgets library =======================================================
The following assertion was thrown building WebFContext:
Duplicate keys found.

If multiple keyed widgets exist as children of another widget, they must have unique keys.
WebFRootRenderObjectWidget has multiple children with key [GlobalObjectKey RenderWidget#a2667].
The relevant error-causing widget was: 
  WebFContext WebFContext:file:///Users/andycall.dong/workspace/webf/webf/lib/src/widget/webf.dart:229:14
When the exception was thrown, this was the stack: 
#0      debugChildrenHaveDuplicateKeys.<anonymous closure> (package:flutter/src/widgets/debug.dart:210:7)
#1      debugChildrenHaveDuplicateKeys (package:flutter/src/widgets/debug.dart:217:4)
#2      MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6593:13)
#3      Element.updateChild (package:flutter/src/widgets/framework.dart:3685:15)
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5322:16)
#5      Element.rebuild (package:flutter/src/widgets/framework.dart:5016:7)
#6      ProxyElement.update (package:flutter/src/widgets/framework.dart:5628:5)
#7      Element.updateChild (package:flutter/src/widgets/framework.dart:3685:15)
#8      SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6441:14)
#9      Element.updateChild (package:flutter/src/widgets/framework.dart:3685:15)
#10     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5322:16)
#11     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5462:11)
#12     Element.rebuild (package:flutter/src/widgets/framework.dart:5016:7)
#13     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2779:19)
#14     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:916:21)
#15     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:360:5)
#16     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1297:15)
#17     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1227:9)
#18     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1085:5)
#19     _invoke (dart:ui/hooks.dart:170:13)
#20     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:401:5)
#21     _drawFrame (dart:ui/hooks.dart:140:31)

@yifei8 yifei8 added this pull request to the merge queue Nov 27, 2023
Merged via the queue into main with commit c8b8813 Nov 27, 2023
24 of 25 checks passed
@yifei8 yifei8 deleted the fix/update_display_input branch November 27, 2023 00:48
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

Successfully merging this pull request may close these issues.

3 participants