player.updateInventory();

It's depreciated but works. It makes the sign work like a player would expect.