Skip to content

Certain File types do not work with ngf-pattern #1023

Closed
@belal-m

Description

@belal-m

Hi,

Apologese if this is not a issue and its just me not being able to get this working correctly. But recently looking at the documentation we are able to use the "ngf-drag-over-class" to allow for css changes of the drop box if the file type is not what specified in the ngf-pattern. How ever i have noticed a few issues with this.

I have specified in ngf-pattern to only allow .png file types, and in the ngf-drag-over-class i have specifed on accept to change the border colour to blue and on reject to apply red. How ever even though i am dragging a .png file into the drop box it changes colour to red. I have managed to get this working by instead of saying ngf-pattern="'.png'" i use ngf-pattern="'image/png'". However the issue with this after testing is that it allows jpeg images to also turn the colour of the drop box to blue when it shouldnt. Can you please advise what is the issue. Below is the code.

div class="uploadArea" ngf-drop ngf-select ng-model="files" ngf-drag-over-class="{accept: 'dragover', reject: 'dragover-err', delay:1}" ngf-multiple="true" accept=".png" ngf-pattern="'.png'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions