Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

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

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants