Prefer the data option instead of the foreach data when specified

Right now the foreach data is always used if it is present, I think that the data argument should be preferred over the foreach data. A use case for this change is when you are only showing a subset of the data that can be selected.