Many species occur across environmental gradients and it is expected that these species will exhibit some signals of adaptation as heterogeneous environments and localized gene flow may facilitate local adaptation. While riparian zones can cross climate gradients, many of which are being impacted by climate change, they also create microclimates for the vegetation, reducing environmental heterogeneity. Species with differing distributions in these environments provide an opportunity to investigate the importance of genetic connectivity in influencing signals of adaptation over relatively short geographical distance. Association analysis with genomic data was used to compare signals of selection to climate variables in two species that have differing distributions along a river traversing a climate gradient. Results demonstrate links between connectivity, standing genetic variation, and the development of signals of selection. In the restricted species, the combination of high gene flow in the middle and lower catchment and occurrence in a microclimate created along riverbanks likely mitigated the development of selection to most climatic variables. In contrast the more widely distributed species with low gene flow showed a stronger signal of selection. Together these results strengthen our knowledge of the drivers and scale of adaptation and reinforce the importance of connectivity across a landscape to maintain adaptive potential of plant species.