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

Tooltip popper using app.config error when using placement prop #1393

Closed
Nemesis19 opened this issue Feb 21, 2024 · 0 comments
Closed

Tooltip popper using app.config error when using placement prop #1393

Nemesis19 opened this issue Feb 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Nemesis19
Copy link

Nemesis19 commented Feb 21, 2024

Environment

  • Operating System: Darwin
  • Node Version: v18.19.1
  • Nuxt Version: 3.10.2
  • CLI Version: 3.10.1
  • Nitro Version: -
  • Package Manager: npm@10.2.4
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Version

2.13

Reproduction

export default defineAppConfig({
	ui: {
		card: {
			divide: 'divide-y divide-gray-100 dark:divide-gray-800',
			body: {
				padding: 'px-4 py-5',
			}
		},
		button: {
			base: 'oruga-button-rootclass w-full disabled:!bg-gray-100 disabled:!text-gray-600 disabled:!shadow-sm disabled:!border',

		},
		tooltip: {
			container: 'bottom-0 top-0',
			background: 'bg-slate-800 text-white',
			base: 'text-xxs text-center px-3 py-1',
			popper: {
				strategy: 'fixed',
                                 placement: 'top'
			}
		}
	}
});

Description

In latest version of nuxt/ui, adding the placement: 'top' property in app.config causes en error on hover for Tooltip component

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'x')
    at offset (offset.js?v=07b9dffb:36:33)
    at Object.forceUpdate (createPopper.js?v=07b9dffb:128:21)
    at createPopper.js?v=07b9dffb:141:20
    at new Promise (<anonymous>)
    at createPopper.js?v=07b9dffb:140:16
    at debounce.js?v=07b9dffb:8:19

I'm sorry but I cannot understand why the placement prop is not working anymore since the package was nuxthq/ui 2.7.

By removing the placement property in app config the tooltip works correctly, however it makes necessary as a workaround to add the :popper="{ placement: 'top' }" directly on every single component instance.

Additional context

I can see in the code, that the PopperOptions interface still has the placement property.

Logs

No response

@Nemesis19 Nemesis19 added the bug Something isn't working label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant