We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2a2ddc commit cdde07bCopy full SHA for cdde07b
app/assets/javascripts/posts.js
@@ -48,6 +48,23 @@ $(() => {
48
$uploadForm.trigger('submit')
49
});
50
51
+ new MutationObserver((records) => {
52
+ for (const record of records) {
53
+ if (record.target instanceof HTMLElement &&
54
+ record.target.id === 'markdown-image-upload' &&
55
+ record.target.classList.contains('is-active')) {
56
+ const fileInput = record.target.querySelector('input[type="file"]');
57
+
58
+ if (fileInput instanceof HTMLInputElement) {
59
+ fileInput.focus();
60
+ }
61
62
63
+ }).observe(document, {
64
+ attributeFilter: ['class'],
65
+ subtree: true,
66
+ });
67
68
$uploadForm.on('submit', async (evt) => {
69
evt.preventDefault();
70
0 commit comments