nwfsc-fram / boatnet

At-Sea Field Data Collection Software Components for Scientific Surveys and Observers
8 stars 5 forks source link

Fix boatnet-keyboard Autocomplete on Trips Details #318

Closed ghost closed 5 years ago

ghost commented 5 years ago

The autocomplete on Trips Details doesn't quite behave well with the onscreen keyboard. There are a lot of errors in the console log, so that'd be a starting place to figure out what's up.

melinashak-noaa commented 5 years ago
  1. Got rid of the error in the console by adding a null check

Before was getting this error: Error in v-on handler: "TypeError: Cannot read property 'target' of undefined"

Code to fix:

if (event) {
      this.$emit('displayKeyboard', event.target);
 }
  1. Resolved another issue where the text was getting reset to the previously selected option when using the on-screen keyboard. You would type, then sometimes the text would get reset and everything you just had just entered disappeared. Resolve this by modifying the BoatnetKeyboard component setting preventClickEvent = true

  2. Currently working on a final issue where the options menu for q-select keeps disappearing while using the on screen keyboard. Was looking into the vue events and see that q-menu emits a hide event, then on the next keypress it emits a show. Keeps toggling between these two states so with every keypress the menu is shown, then hid, shown, then hid. Believe it may be caused by the q-select losing focus. On the first keypress it gains focus and shows the menu. Then when i select a character on the keyboard it loses focus and hides the menu. On the next keypress it regains focus and shows the menu. So looking for a way to modify this behavior.

melinashak-noaa commented 5 years ago

image

ghost commented 5 years ago

Interesting. The autocomplete functionality we have for the q-select is probably what's causing all those redraws (hide/show etc)

melinashak-noaa commented 5 years ago

https://github.com/nwfsc-fram/boatnet/pull/336

melinashak-noaa commented 5 years ago

close for now, there's still the issue with hiding and showing of options, but got rid of the console errors