If you try to replace an initial number by selecting a cell and clicking on any number in the bottom bar, it won't affect the number because they are not overwritable. But it still counts as a user action. You can see this by trying to undo your input, which will try to undo changes that were never made to the initial numbers every time you tap Undo.
To reproduce:
Start a new game and fill any empty cell with any number on the grid
Select any initial digit cell and try to overwrite it with a random digit x times (it won't affect the cell)
Tap the Undo button
You are expecting the button to undo a visible change made in the first step, and instead you need to tap the Undo button x+1 times to undo a visible action. To fix this, make the interaction with the initial numbers not count as a user action.
If you try to replace an initial number by selecting a cell and clicking on any number in the bottom bar, it won't affect the number because they are not overwritable. But it still counts as a user action. You can see this by trying to undo your input, which will try to undo changes that were never made to the initial numbers every time you tap Undo.
To reproduce:
You are expecting the button to undo a visible change made in the first step, and instead you need to tap the Undo button x+1 times to undo a visible action. To fix this, make the interaction with the initial numbers not count as a user action.