Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: focusing input displayed after clicking on a link more reliable
- Loading branch information
Showing
4 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/assets/javascripts/discourse/components/link-to-input.js.es6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default Ember.Component.extend({ | ||
showInput: false, | ||
|
||
click() { | ||
this.get("onClick")(); | ||
|
||
Ember.run.schedule("afterRender", () => { | ||
this.$() | ||
.find("input") | ||
.focus(); | ||
}); | ||
|
||
return false; | ||
} | ||
}); |
5 changes: 5 additions & 0 deletions
5
app/assets/javascripts/discourse/templates/components/link-to-input.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{#if showInput}} | ||
{{yield}} | ||
{{else}} | ||
<a href>{{i18n key}}</a> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,6 +157,10 @@ | |
font-style: italic; | ||
} | ||
|
||
.display-edit-reason { | ||
display: inline; | ||
} | ||
|
||
#edit-reason { | ||
margin: 4px; | ||
} | ||
|
4e0c06a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit has been mentioned on Discourse Meta. There might be relevant details there:
https://meta.discourse.org/t/regression-edit-reason-input-not-autofocussed/64779/4