question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

datatable broken in safari & ios

See original GitHub issue

Describe the bug

I have a simple application with a data table. It misrenders in safari. The table rows are appearing next to the header instead of below.

To Reproduce

data class Foo(val foo:String)

render("#target") {
        val s = storeOf(listOf(Foo("foo"), Foo("bar"), Foo("foobar")))
        val fooLens = buildLens<Foo, String>(
            id = "fooCol",
            getter = { it.foo },
            setter = { old, v -> old.copy(foo = v) })
        val selected = storeOf<Foo?>(null)
        s.data.render {
            dataTable(rows = s, rowIdProvider = { it.foo }, selection = selected) {
                columns() {
                    column(title = "Foo") {
                        lens(fooLens)
                    }
                }
            }
        }
}

Expected behavior

rows appear below each other

Screenshots

image

Desktop (please complete the following information):

  • MacOS / IOS
  • Safari
  • Fritz 0.13

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jillesvangurpcommented, Nov 30, 2021

Maybe just document this in the readme of the component library. Something like :

Safari’s quirk mode has several known issues with Fritz2 components. Fritz2 components relies on html5 and css standard behavior. To prevent browsers such as Safari from engaging their quirks mode, put <!doctype html> at the top of your index.html.

1reaction
jillesvangurpcommented, Nov 29, 2021

Thanks, I played a bit with this to figure out what causes this. At first glance all the differences are trivial. So, I narrowed it down by trying things one by one.

It turns out that adding this at the top of our index.html fixes things:

<!doctype html>

Safari apparently goes into some legacy/quirks mode without that: https://hsivonen.fi/doctype/

Never knew that was a thing. Probably worth documenting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What could cause DataTables to break on iOS devices (Safari)?
I decided to check out this issue and connect to the app on my own iPad. There I noticed that the DataTable is...
Read more >
Datatables iOS, Safari not showing at all - Stack Overflow
My issue was resolved with the latest version of the library.
Read more >
[DataTable] 1st column blank on iOS Safari narrow screens
On my iPhone 6S with iOS 12 in portrait mode, on Safari or inside Shopify mobile app, Data Table's 1st row appears blank:....
Read more >
Data-table not working on old iOS browser safari and chrome
Hi,. I am using data-table, it works fine on latest browsers, thanks for the great product. But I did test it on an...
Read more >
Context Menu not working on IOS - Prime Community Forum
On Android, long pressing opens the Contextmenu, but it is not working on Iphone (both Safari and Chrome). Could anyone help me?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found