Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Akbarism/fix autocomplete #87

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

akbarism
Copy link

No description provided.

Copy link

netlify bot commented Dec 14, 2023

Deploy Preview for vue-google-maps-community-fork canceled.

Name Link
🔨 Latest commit fdde864
🔍 Latest deploy log https://app.netlify.com/sites/vue-google-maps-community-fork/deploys/657acffbc6e506000887c158

@@ -46,10 +46,11 @@ export default {
// get correct input from fallback or slot
let refInput = _this.$refs.input
if (_this.$slots.input) {
const refName = _this.$slots.input()[0].props.ref
const scopedInput = _this.$slots.input()[0].ref.i.ctx.$refs[refName]
const input = _this.$slots.input().find((el) => el.props.ref == 'input')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, this line was failing, I put a comment inside the template:

<template #input="slotProps">
      <!-- Some comment  -->
      <input v-bind="slotProps" ref="input" />
  </template>

And got errors that props/ref was not defined. Could be solved by not putting comments in the template, but a better fix might be to check if the props/ref is defined:

const input = _this.$slots.input().find((el) => el?.props?.ref && el.props.ref == 'input')

@NathanAP
Copy link
Owner

NathanAP commented Jan 3, 2024

Hey guys! Sorry for late reply.

Does #15 has anything related with this PR? If it does, I recommend you look through it and see the limitations we found. Otherwise, let me know if everything is working properly :)

@PieterBoeren
Copy link

I guess it does, it solves the same problem (with the autocomplete). The PR from @akbarism does a better job at finding the ref, at the price of hardcoding the name of it ("input"). So I guess the solution in #15 is a bit better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants