cedricium / firefly

:fire: Vue.js / Express.js Fullstack Web Application
MIT License
3 stars 1 forks source link

Certain non-alphanumeric characters won't populate search input field when typed in url #15

Open cedricium opened 6 years ago

cedricium commented 6 years ago

In an upcoming change, a watcher is set on $route.query.search and the updated value gets assigned to Header.vue's data.search value. The code addition is as follows:

watch: {
  '$route.query.search': {
    immediate: true,
    handler (value) {
      this.search = value;
  }
}

This means if a user opens the link: http://<domain>/#/?search=example, the search input field will be populated with example.

With this implementation, any of the following characters will cause the search input field to not be populated, rather remaining blank: ! , ' # & ( ) %

The % causes an entire redirect to the name: sites route.

EDIT: The change has been committed: 10dd08d