A triple boil-down before the sugar and vinegar are added makes the onions extra soft. Choose a lightly hopped beer that's rich in malt and not too bitter.
Check it out here: https://www.goodfood.com.au/recipes/craft-beer-onion-pickle-recipe-20170911-gyev99