Skip to content

nimble-table data doesn't render in Safari #984

Closed
@jattasNI

Description

🐛 Bug Report

When you open a demo page that contains a nimble-table in Safari, the table shows empty cells and there are errors in the dev tools console.

💻 Repro or Code Sample

Visit https://nimble.ni.dev/storybook/example-client-app/#/customapp in Safari and scroll to the table example

🤔 Expected Behavior

Table renders data like it does in other browsers.

😯 Current Behavior

image

Repeated console errors:

[Error] TypeError: undefined is not an object (evaluating 'n.appendChild')
	runGuarded (polyfills.54ab400a48eba0a6.js:1:2165)
	appendChild
	appendTo (main.a4d212b3f0e17485.js:1:264961)
	render (main.a4d212b3f0e17485.js:1:268254)
	renderTemplate (main.a4d212b3f0e17485.js:1:244195)
	finishInitialization (main.a4d212b3f0e17485.js:1:243793)
	onConnectedCallback (main.a4d212b3f0e17485.js:1:242794)
	connectedCallback (main.a4d212b3f0e17485.js:1:244616)
	connectedCallback (main.a4d212b3f0e17485.js:1:257647)
	runGuarded (polyfills.54ab400a48eba0a6.js:1:2092)
	insertBefore
	insertBefore (main.a4d212b3f0e17485.js:1:265051)
	d$ (main.a4d212b3f0e17485.js:1:261462)
	handleChange (main.a4d212b3f0e17485.js:1:263178)
	notify (main.a4d212b3f0e17485.js:1:231601)
	call (main.a4d212b3f0e17485.js:1:233925)
	i (main.a4d212b3f0e17485.js:1:229445)
	o (main.a4d212b3f0e17485.js:1:229526)
	(anonymous function) (polyfills.54ab400a48eba0a6.js:1:28207)
	runTask (polyfills.54ab400a48eba0a6.js:1:2590)
	invokeTask (polyfills.54ab400a48eba0a6.js:1:8243)

💁 Possible Solution

Not a solution, but some initial debugging showed:

  • In Firefox, cellTemplateChanged() (in cell/index.ts) is called many times but this.isConnected is false so it exits early.
  • In Safari, cellTemplateChanged() is being called many times but this.isConnected is true. However this.cellContentContainer is undefined. This results in a call within FAST code to view.appendTo(undefined) and thus undefined.appendChild().

🔦 Context

First noticed when testing virtualization in different browsers: #966 (comment)

When this is fixed we should re-validate that scrolling performance is good in Safari (no flickering).

🌍 Your Environment

  • OS & Device: macOS 13.1
  • Browser: Safari
  • Version: 16.2 (18614.3.7.1.5)

@msmithNI also reproduced in the Windows WebKit build from Playwright: https://playwright.azureedge.net/builds/webkit/1751/webkit-win64.zip

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions