Chris Hamilton
Chris Hamilton
Just want to express my interest in fixing this. This is a basic function of almost every site in existence, yet implementing it in Next.js is extremely complicated. Since we...
> I've looked into this a bit more. Use case is rather straightforward: display a warning dialog when user is about to navigate away from an unsubmitted form using the...
Here's a simple reproduction: https://next-41422-bug-repro.vercel.app source: https://github.com/ChrisHamilton91/next-41422-bug-repro pages/index.tsx ```jsx import Router from "next/router"; import { useEffect } from "react"; export default function Home() { useEffect(() => { Router.beforePopState(() => false);...
Looking into it further, seems like it's impossible to stop the browser from moving the index of history along, best you can do is push the old state in on...
@pkozlowski-opensource that use case describes an object with a unique identifier, not an array of primitives. It also specifies that the function needs to return unique values for all unique...
Update: I no longer think this is a good solution because it seems to be a deeper problem with change detection. The bug is also reproducible for objects. --- I...
@mlc-mlapis Hmmm, I think it's a bit off to not allow duplicate primitives in an iterable by default. It's very unintuitive and produces undefined behaviour for unaware users. I understand...
@mlc-mlapis The use case from the issue. Two way binding on a list of inputs and their string values. The default behaviour as it is now causes strange DOM behaviour...
@mlc-mlapis Have you looked at the stackblitz? What I'm saying is: the default trackBy function found here: https://github.com/angular/angular/blob/master/packages/core/src/change_detection/differs/default_iterable_differ.ts#L27 does not uniquely identify primitives, causing bugs. I'm not talking about supplying...
Ah, glad you agree! I'll edit my original comment to show the link, probably more clear.