Drag'n drop a file in the composer shouldn't start the upload if a category must be selected

When allow uncategorized topics is disabled, drag’n drop a file in the composer starts the upload without any error message though it doesn’t work.
If the title field is focused (it is by default), it also fills it with the media markdown text.

The expected behavior is that drag’n drop a file shouldn’t work, or trigger an error message that asks us to select a category first.

Video example:

Same behavior with safe-mode, I’m using Discourse 2.9.0.beta5 (e0364cf228)

2 Likes

Oh looks like it is not even uploading the file to the right place in this case … it is uploading it to the title?

We should be stealing focus here I guess. If focus is correct does it work correctly?

Notice that the issue only happens when allow uncategorized topics is disabled and no category is currently selected.
You won’t encounter it on try.discourse or meta with their current settings.

I suppose the upload process works in the background since there’s no error:

But I think the title field focus isn’t the issue.

Apart from the title field, the composer text area is properly disabled if no category is selected.
Drag’n drop a file shouldn’t process the upload at all unless we first select a category.

I can confirm that files and uplodas would work in composer when: allow uncategorized topics is disbaled and no category for the topic is selected the file would be uploaded and save on either drag and drop or browse.

But I am not sure what exactly is the issue, since the topic is still draft, the expected behavouir might not be straight forward, regarding this:

How would that hold with save draft feature?

Also interestingly when the draft is deleted the file would still exist in the uplodas/defualts, would those orphaned files be deleted eventually? I am not sure what is the answer, but releavnt long discussion can be found at Is there a way to delete old/irrelevant uploads?

1 Like