Yes, but the average Swiss voter is very proud of its direct democracy, and scared that joining the EU would significantly weaken it.
Therefore, having to follow EU law in some very specific areas, while remaining independent in others is a decent path, and a compromise very typical of Swiss policy