What’s the best strategy for using a desktop friendly widgets when using ionic as a PWA? I have a form with ion-select and ion-datetime. They give me nice pickers that slide up from the bottom of the screen on mobile, but on desktop I would prefer a more standard select dropdown and probably the material design datepicker.
I was thinking of using a media query to hide and show different versions of the form inputs. Is there a best practice here?
Instead of media queries, you can also use platform to detect if you are on a desktop device.
import { Platform } from 'ionic-angular';
@Component({...})
export MyPage {
constructor(public plt: Platform) {
if (this.plt.is('core')) {
// This will only print when on a desktop device
console.log('I am a desktop device!');
}
}
}