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

FloatLabel: ReferenceError: FloatLabelStyle is not defined #5840

Closed
readStudy opened this issue Jun 6, 2024 · 0 comments
Closed

FloatLabel: ReferenceError: FloatLabelStyle is not defined #5840

readStudy opened this issue Jun 6, 2024 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@readStudy
Copy link

Describe the bug

I'm using PrimeVue and Vue.js from a CDN with a script tag.
When I tried to use the float label, it did not display the element.
image

After further investigation, it seems there might be an issue in floatlabel.js

...
(primevue.basecomponent, FloatLabelStyle, Vue);

It seems that it use wrong variable: FloatLabelStyle, which could be why it can't find the FloatLabelStyle.
the correct might be

...
}(primevue.basecomponent, primevue.floatlabel.style, Vue);

Reproducer

https://mystudybook.github.io/html/vue_test/floatlabel.html

PrimeVue version

3.52.0

Vue version

3.x

Language

ES6

Build / Runtime

Vue CLI App

Browser(s)

Chrome 125.0.6422.142 (arm64)

Steps to reproduce the behavior

I'm using PrimeVue and Vue.js from a CDN with a script tag.

the link displays the error: https://mystudybook.github.io/html/vue_test/floatlabel.html

below is the full html

<html lang="en">
  <head>
    <title>PrimeVue + CDN</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <link rel="stylesheet" href="https://unpkg.com/primevue/resources/themes/lara-light-green/theme.css" />

    <script src="https://cdn.jsdelivr.net/npm/vue@3.4.27/dist/vue.global.prod.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/core/core.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/fileupload/fileupload.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/dialog/dialog.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/dialog/style/dialogstyle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/progressspinner/progressspinner.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/autocomplete/autocomplete.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/button/button.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/button/style/buttonstyle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/progressbar/progressbar.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/floatlabel/style/floatlabelstyle.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/primevue@3.52.0/floatlabel/floatlabel.js"></script>

  </head>
  <body>
    <div id="app">
      <p-floatlabel style="display: initial;">
        <p-autocomplete id="prefix" name="prefix" v-model="prefix" dropdown :suggestions="items" @complete="search" placeholder="Please Enter a Prefix" style="margin: 5px;"></p-autocomplete>
        <label for="prefix">Prefix</label>
      </p-floatlabel>

    </div>

    <script>
      const { createApp, ref } = Vue;
      const prefix = ref("");
      const app = createApp({
        setup() {
          const items = ref([]);
          const search = (event) => {
            let _items = ['test1', 'test2'];
            let result = _items.filter(_items => _items.includes(event.query));
            if(result.length == 0) {
              result = _items;
            }

            items.value = result;
          }          
          

          return {
            prefix,
            items,
            search
          };
        },
      });
      app.use(primevue.config.default);
      app.component('p-file', primevue.fileupload);
      app.component('p-dialog', primevue.dialog);
      app.component('p-progressspinner', primevue.progressspinner);
      app.component('p-autocomplete', primevue.autocomplete);
      app.component('p-button', primevue.button);
      app.component('p-progressbar', primevue.progressbar);
      app.component('p-floatlabel', primevue.floatlabel);
      app.mount('#app');
    </script>

  </body>
</html>

Expected behavior

No response

@readStudy readStudy added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 6, 2024
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 7, 2024
@tugcekucukoglu tugcekucukoglu added this to the 3.53.0 milestone Jun 7, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants