Coder Social home page Coder Social logo

Comments (17)

ScarletKuro avatar ScarletKuro commented on July 22, 2024 2

Sounds like a popup protection or so

More like Safari being a special snowflake as always 😒

from mudblazor.

sardar97 avatar sardar97 commented on July 22, 2024 1

Sorry guys for being late to answer I was very busy.
@igotinfected I tried with MudBlazor Docs.Server as well it is not working only on safari.

See the Example video

from mudblazor.

igotinfected avatar igotinfected commented on July 22, 2024 1

Sorry guys for being late to answer I was very busy. @igotinfected I tried with MudBlazor Docs.Server as well it is not working only on safari.

See the Example video

No worries! Been looking for solutions ;) Thought we would need to revert the recent changes to MudFileUpload because of Safari behaviour but I may have found a more robust way that works on every browser while keeping the reworked MudFileUpload. Will be opening a PR tonight or tomorrow if everything goes well.

The short version of the issue is that Safari doesn't like when some events are triggered programmatically without direct user interaction. Since we are using JS interop to trigger the file picker, Safari won't acknowledge the action when it is executed via Blazor Server, I'm assuming because there is a back and forth between client & server which might not pass whichever checks Safari runs.

from mudblazor.

ScarletKuro avatar ScarletKuro commented on July 22, 2024 1

it doesn't work in my project but the docs site does work

Sounds like cache issue. If the functionality wasn't working, it wouldn't work in docs or trymudblazor.

from mudblazor.

ScarletKuro avatar ScarletKuro commented on July 22, 2024 1

All problems were solved via discord.

from mudblazor.

ScarletKuro avatar ScarletKuro commented on July 22, 2024 1

great, but it would be cool to have the solution here for the googlers

  1. The opening issue in Safari was fixed via clearing cache, obj, and bin folders.
  2. The problem in edge/chrome with reopening(firing twice) was solved by removing HtmlTag="label" from the button in the ActivatorContent since it wasn't clear to the person from the guide from where it should be removed.

from mudblazor.

sardar97 avatar sardar97 commented on July 22, 2024

@henon

from mudblazor.

ScarletKuro avatar ScarletKuro commented on July 22, 2024

@igotinfected

from mudblazor.

igotinfected avatar igotinfected commented on July 22, 2024

@sardar97 can you describe what exactly isn't working + your version of MacOS and Safari? Seems to be working for me:

image image

from mudblazor.

sardar97 avatar sardar97 commented on July 22, 2024

@igotinfected actually it works for me as well with mudblazor doc but with my project not working I don't know why!
However I works on other browser with my project.
by the way my project render is Server Global
here a video I showed the codes which I used same as mudblazor doc and a picture to show my safari and Mac version.

Click to the Video

Screenshot :
Screenshot 2024-06-09 at 4 30 58 PM

from mudblazor.

ScarletKuro avatar ScarletKuro commented on July 22, 2024

Can you show your code?

from mudblazor.

igotinfected avatar igotinfected commented on July 22, 2024

@ScarletKuro it's in the video, but I can reproduce it just by running the current docs with the Docs.Server project and testing the first MudFileUpload examples. I'm not quite sure what is causing it though. It works on all other browsers, and adding logs to the mudWindow.click function shows that it is executed as expected... The drag and drop examples work with clicks btw.

Edit: missing words

from mudblazor.

henon avatar henon commented on July 22, 2024

The short version of the issue is that Safari doesn't like when some events are triggered programmatically without direct user interaction.

Sounds like a popup protection or so

from mudblazor.

Welchen avatar Welchen commented on July 22, 2024

Are we sure this is fixed? I am running 7.2.0/7.3.0 and still having the same problem that @sardar97 is reporting where it doesn't work in my project but the docs site does work. Was working in v6 but when I have now upgraded to v7 it doesn't work in Safari.

Also when using Edge the the Open and Cancel buttons will redisplay the dialog on the first use.

from mudblazor.

igotinfected avatar igotinfected commented on July 22, 2024

@Welchen other than the cache, make sure you remove the HtmlTag and for properties/attributes. These are no longer necessary and could be causing your issue:

v6

<MudFileUpload T="IBrowserFile" FilesChanged="UploadFiles">
    <ButtonTemplate>
        <MudButton HtmlTag="label"
                   Variant="Variant.Filled"
                   Color="Color.Primary"
                   StartIcon="@Icons.Material.Filled.CloudUpload"
                   for="@context.Id">
            Upload Files
        </MudButton>
    </ButtonTemplate>
</MudFileUpload>

v7

<MudFileUpload T="IBrowserFile" FilesChanged="UploadFiles">
    <ActivatorContent>
        <MudButton Variant="Variant.Filled"
                   Color="Color.Primary"
                   StartIcon="@Icons.Material.Filled.CloudUpload">
            Upload Files
        </MudButton>
    </ActivatorContent>
</MudFileUpload>

from mudblazor.

henon avatar henon commented on July 22, 2024

great, but it would be cool to have the solution here for the googlers

from mudblazor.

Welchen avatar Welchen commented on July 22, 2024
  1. The problem in edge/chrome with reopening(firing twice) was solved by removing HtmlTag="label" from the button in the ActivatorContent since it wasn't clear to the person from the guide from where it should be removed.

To elaborate, the documentation for MudFileUpload states to remove the HtmlTag if you have it. I looked at the MudFileUpload and didn't see one, so didn't think there was anything to be removed. That statement in the docs is in reference to the button or activator in the ActivatorContent. Didn't think to look down in there. Now that I know what I was supposed to be looking for, I understand it.

from mudblazor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.