Si el parámetro no existe no se puede trimear

This commit is contained in:
f 2021-09-18 13:31:15 -03:00
parent 51f4092cf8
commit b4e0504f97

View file

@ -16,7 +16,7 @@ export default class extends Controller {
}
connect () {
const q = new URLSearchParams(window.location.search).get('q').trim()
const q = new URLSearchParams(window.location.search).get('q')?.trim()
if (q) {
this.qTarget.value = q