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

[v3] Modal always render fullscreen on mobile #2463

Open
nklsw opened this issue Oct 25, 2024 · 3 comments
Open

[v3] Modal always render fullscreen on mobile #2463

nklsw opened this issue Oct 25, 2024 · 3 comments
Assignees
Labels
bug Something isn't working v3 #1289

Comments

@nklsw
Copy link

nklsw commented Oct 25, 2024

Environment

MacOS 15.0.1 / Arc 1.63.0
Also tested on iOS 18.0.1 / Safari

Version

v3.0.0-alpha.7

Reproduction

https://ui3.nuxt.dev/components/modal

Description

In version 3.0-alpha, I noticed that modals are now displayed in fullscreen mode on mobile devices / small screens by default. This can be reproduced with the examples in the documentation.

I don't expect this to be intended as default. Also in the first example in the modal documentation it's hard to leave the dialoge, as there is no button for closing.

Additional context

Image

Logs

No response

@nklsw nklsw added bug Something isn't working triage v3 #1289 labels Oct 25, 2024
@nklsw nklsw changed the title Modal always render fullscreen on mobile [v3] Modal always render fullscreen on mobile Oct 27, 2024
@gioboa
Copy link

gioboa commented Nov 14, 2024

Hi, there is the specific example with the close button.
The library is using this dialog and it's taking the full screen too.
@sandros94 do you have any feedback about that?

@sandros94
Copy link
Collaborator

By now all the docs example should already include a close button by default, so if we have missed any feel free to call them out! 🙏

The library is using this dialog and it's taking the full screen too.

@gioboa Nuxt UI v2 uses Headless UI under the hood, while v3 is using Radix Vue (soon rebranded as Reka UI) and this is the current dialog component that is being used.

I don't expect this to be intended as default.

Indeed it should not (that's why there's a dedicated fullscreen prop)

@sandros94 sandros94 removed the triage label Nov 14, 2024
@sandros94
Copy link
Collaborator

sandros94 commented Nov 14, 2024

Indeed it should not (that's why there's a dedicated fullscreen prop)

Ah, my bad! It is working as intended.

This is actually a long term debate, all the way back to the beginning of Nuxt UI v2.

The three main proposed variants for mobile/small screens are:

  • fullscreen
  • in the middle of the screen
  • at the bottom of the screen

a definite choice hasn't been picked, yet

In the meantime you could edit your specified modal like so:

<template>
  <UModal
    :ui="{
      content: 'max-w-lg w-[90vw] h-auto rounded-[calc(var(--ui-radius)*2)] shadow-lg ring',
    }"
  >
    <!-- content -->
  </UModal>
</template>

or project wide via app.config.ts

export default defineAppConfig({
  ui: {
    modal: {
      variants: {
        fullscreen: {
          false: {
            content: 'max-w-lg w-[90vw] h-auto rounded-[calc(var(--ui-radius)*2)] shadow-lg ring',
          },
        },
      },
    },
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 #1289
Projects
None yet
Development

No branches or pull requests

3 participants