Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clearing the comment input after a successful comment post #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

littleStudent
Copy link

fixes #8

@@ -151,6 +151,7 @@ viewAddComment postingDisabled maybeUser =
[ class "form-control"
, placeholder "Write a comment..."
, attribute "rows" "3"
, value commentText

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a subtle bug—I just tried this same fix locally (before checking to see if someone else had already submitted a PR).

Put some text in the box, then move your cursor back to the beginning (or middle) and start mashing on the keyboard. The caret will at some point jump to the end of the text. See https://github.com/elm-lang/html/issues/55. 🙁

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Did not know that.
I seems like there is no easy solution for that?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed in Elm 0.19. I'll merge this once that's released! 🎉

Copy link
Owner

@rtfeldman rtfeldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will merge post-0.19 when the bug with value is fixed. Thanks!

rtfeldman pushed a commit that referenced this pull request Aug 11, 2018
# This is the 1st commit message:
Upgrade to 0.19, rearchitect everything!

# The commit message #2 will be skipped:

#	Add elm.json

# The commit message #3 will be skipped:

#	Vendor date-format and ISO8601

# The commit message #4 will be skipped:

#	Refactor out Json.Encode.Extra

# The commit message #5 will be skipped:

#	Use Browser.setScrollTop over Dom.Scroll.toTop

# The commit message #6 will be skipped:

#	UrlParser --> Url.Parser

# The commit message #7 will be skipped:

#	Use Posix over Date

# The commit message #8 will be skipped:

#	Use new style attribute

# The commit message #9 will be skipped:

#	% --> modBy

# The commit message #10 will be skipped:

#	wip

# The commit message #1 will be skipped:

#	Switch to DateFormat

# The commit message #2 will be skipped:

#	wip

# The commit message #3 will be skipped:

#	Upgrade some stuff

# The commit message #4 will be skipped:

#	Use Posix more

# The commit message #5 will be skipped:

#	Fix some ISO8601 and Util stuff.

# The commit message #6 will be skipped:

#	Fix some URL parsing stuff.

# The commit message #7 will be skipped:

#	Fix a toString

# The commit message #8 will be skipped:

#	s/browser/application

# The commit message #9 will be skipped:

#	Use new HttpBuilder QueryParameter

# The commit message #10 will be skipped:

#	Use new Encode.list

# The commit message #1 will be skipped:

#	Fix some more toString usages

# The commit message #2 will be skipped:

#	Don't shadow

# The commit message #3 will be skipped:

#	modifyUrl -> replaceUrl

# The commit message #4 will be skipped:

#	Update main

# The commit message #5 will be skipped:

#	Set titles

# The commit message #6 will be skipped:

#	Use a parser for 8601

# The commit message #7 will be skipped:

#	Remove a Debug.crash

# The commit message #8 will be skipped:

#	More timezone stuff

# The commit message #9 will be skipped:

#	REVERT THIS

# The commit message #10 will be skipped:

#	Give setScrollTop another argument.

# The commit message #1 will be skipped:

#	Add Makefile

# The commit message #2 will be skipped:

#	s/View/Page/g

# The commit message #3 will be skipped:

#	s/Page/CurrentPage

# The commit message #4 will be skipped:

#	Use :: over [foo] ++

# The commit message #5 will be skipped:

#	Move Username into its own module

# The commit message #6 will be skipped:

#	Move Article.Tag into its own module

# The commit message #7 will be skipped:

#	Move Feed.Source into its own module

# The commit message #8 will be skipped:

#	Move Article.Slug into its own module

# The commit message #9 will be skipped:

#	Fix compilation errors.

# The commit message #10 will be skipped:

#	Rename Data.UserPhoto to Data.User.Photo

# The commit message #1 will be skipped:

#	:art: elm-format

# The commit message #2 will be skipped:

#	s/defaultValue/value/g

# The commit message #3 will be skipped:

#	Add favicons

# The commit message #4 will be skipped:

#	Passwords must be at least 6 chars.

# The commit message #5 will be skipped:

#	Empty string photos should also use default photo.

# The commit message #6 will be skipped:

#	:art: Give a thing a name

# The commit message #7 will be skipped:

#	Upgrade to lukewestby/http-builder 1.0.1

# The commit message #8 will be skipped:

#	Don't use record updates where they no longer work.

# The commit message #9 will be skipped:

#	:art: elm-format v0.8

# The commit message #10 will be skipped:

#	Fix Parser errorsg

# The commit message #1 will be skipped:

#	Upgrade Iso8601

# The commit message #2 will be skipped:

#	rm elm-package.json

# The commit message #3 will be skipped:

#	Refactor decodeUserFromJson

# The commit message #4 will be skipped:

#	Refactor sessionChange

# The commit message #5 will be skipped:

#	Explicitly name more arguments

# The commit message #6 will be skipped:

#	Use pattern match over Maybe.map/withDefault

# The commit message #7 will be skipped:

#	Upgrade to latest NoRedInk/json-pipeline-decoder

# The commit message #8 will be skipped:

#	Restore rtfeldman/elm-validate

# The commit message #9 will be skipped:

#	Replace SelectList with custom data structure

# The commit message #10 will be skipped:

#	Finish getting things compiling.

# The commit message #1 will be skipped:

#	Fix date formatting, upgrade elm-validate

# The commit message #2 will be skipped:

#	Drop obsolete Util.pair and Util.viewIf

# The commit message #3 will be skipped:

#	Unify Data.* and Request.*
#
#	I had a few guiding principles here:
#
#	1. Organize modules around data structures. How should it be possible to
#	create these things? If it should only be possible to create these
#	things through a HTTP request, then that's the only way I'll expose!
#	Encoding expectations in APIs is awesome.
#	2. Tailor client data structures to the client, not to the server. For
#	example, I'm not using updatedAt anywhere. Why decode it, store it, and
#	expose it just because the server sends it?
#	3. Unify User, Author, and Profile into User with one type parameter.
#	Email and AuthToken are only used for the current user, whereas
#	following is only used for other users. They share all the rest of the
#	info!
#	4. Drop Ports.elm in favor of exposing those APIs where they make sense.

# The commit message #4 will be skipped:

#	Split User into Me and Profile.
#
#	They're fundamentally different. Having 3 fields in common isn't reason
#	enough to have them share a type!

# The commit message #5 will be skipped:

#	Reorganize Session

# The commit message #6 will be skipped:

#	Get things compiling.

# The commit message #7 will be skipped:

#	Convert fragment to path

# The commit message #8 will be skipped:

#	Reorganize some comments

# The commit message #9 will be skipped:

#	Clean up some comments

# The commit message #10 will be skipped:

#	Pass flags properly

# The commit message #1 will be skipped:

#	Fix some hrefs

# The commit message #2 will be skipped:

#	Fix feed source ordering

# The commit message #3 will be skipped:

#	De-vendor iso8601

# The commit message #4 will be skipped:

#	Demote parser and regex to indirect deps

# The commit message #5 will be skipped:

#	:skull: Dead code

# The commit message #6 will be skipped:

#	Update some more comments

# The commit message #7 will be skipped:

#	Past tense msg

# The commit message #8 will be skipped:

#	Use Api.url over apiUrl

# The commit message #9 will be skipped:

#	s/profile/author

# The commit message #10 will be skipped:

#	:skull: obsolete comment

# The commit message #1 will be skipped:

#	Replace ArticleRecord with Metadata

# The commit message #2 will be skipped:

#	Document Metadata

# The commit message #3 will be skipped:

#	Rename UserPhoto to Avatar

# The commit message #4 will be skipped:

#	Renamte get to fetch

# The commit message #5 will be skipped:

#	Move author out of metadata

# The commit message #6 will be skipped:

#	:art: elm-format

# The commit message #7 will be skipped:

#	Reorganize some stuff

# The commit message #8 will be skipped:

#	Upgrade to elm-validate 4.0.0

# The commit message #9 will be skipped:

#	Inline Article.delete into Page.Article

# The commit message #10 will be skipped:

#	Add Api.listErrors

# The commit message #1 will be skipped:

#	Store session info from Main.

# The commit message #2 will be skipped:

#	s/convert/transform/g

# The commit message #3 will be skipped:

#	Revamp Author and Me

# The commit message #4 will be skipped:

#	Bump elm-iso8601 for bugfix

# The commit message #5 will be skipped:

#	Replace Me with AuthToken knowing Username

# The commit message #6 will be skipped:

#	Swap order on Session.Internals

# The commit message #7 will be skipped:

#	wip

# The commit message #8 will be skipped:

#	s/NoOp/Ignored/g

# The commit message #9 will be skipped:

#	s/Views.Article/Article.Preview/g

# The commit message #10 will be skipped:

#	Move Views.Author into Author.

# The commit message #1 will be skipped:

#	Move Skeleton and Views.Errors into Page

# The commit message #2 will be skipped:

#	Rename Views.Follow to Author.Follow

# The commit message #3 will be skipped:

#	Drop obsolete loading spinner

# The commit message #4 will be skipped:

#	Rename Views.Assets to Assets

# The commit message #5 will be skipped:

#	Rename Views.Article.Favorite to Article.Favorite

# The commit message #6 will be skipped:

#	Rename ActivePage to Page

# The commit message #7 will be skipped:

#	Rename Views.Form to Field

# The commit message #8 will be skipped:

#	Revert "Rename Views.Form to Field"
#
#	This reverts commit 15032ce.

# The commit message #9 will be skipped:

#	Rename Views.Form to Form

# The commit message #10 will be skipped:

#	Split Util into more specific modules.

# The commit message #1 will be skipped:

#	Move viewTimestamp into Timestamp.view

# The commit message #2 will be skipped:

#	Remove Author.Follow

# The commit message #3 will be skipped:

#	Rename LoggedInUser to Viewer, other stuff.

# The commit message #4 will be skipped:

#	Revamp Article Editor data model.

# The commit message #5 will be skipped:

#	Revamp all the everythings.

# The commit message #6 will be skipped:

#	Rename Creds to Cred

# The commit message #7 will be skipped:

#	Remove AuthRequired

# The commit message #8 will be skipped:

#	Rule out some more login states.

# The commit message #9 will be skipped:

#	Add more error handling to Api

# The commit message #10 will be skipped:

#	Fix typo

# The commit message #1 will be skipped:

#	s/Log in/Sign in

# The commit message #2 will be skipped:

#	Add Loading.error

# The commit message #3 will be skipped:

#	Use pattern matching more

# The commit message #4 will be skipped:

#	:skull: dead code

# The commit message #5 will be skipped:

#	Go back to the old style of tupled update

# The commit message #6 will be skipped:

#	Consolidate update helpers

# The commit message #7 will be skipped:

#	Be more consistent about Fail and Log.error.

# The commit message #8 will be skipped:

#	Inline banner

# The commit message #9 will be skipped:

#	:skull: withFavoriteButton

# The commit message #10 will be skipped:

#	Simplify viewComment

# The commit message #1 will be skipped:

#	Make followButton cases nicer

# The commit message #2 will be skipped:

#	Centralize optionalErrors

# The commit message #3 will be skipped:

#	Better names

# The commit message #4 will be skipped:

#	Minor tweaks

# The commit message #5 will be skipped:

#	Ellipses

# The commit message #6 will be skipped:

#	Revert "Ellipses"
#
#	This reverts commit 267256f92c76313203882e5289ecee0a4bf95ab1.

# The commit message #7 will be skipped:

#	:skull: unused import

# The commit message #8 will be skipped:

#	Remove Email opaque type

# The commit message #9 will be skipped:

#	Revert "Remove Email opaque type"
#
#	This reverts commit 92b21c2d83c63890c856823efe0545c8c780e89c.

# The commit message #10 will be skipped:

#	:skull: Form

# The commit message #1 will be skipped:

#	wip

# The commit message #2 will be skipped:

#	Simplify some stuff

# The commit message #3 will be skipped:

#	Drop em dash

# The commit message #4 will be skipped:

#	Fix some Author decoder stuff

# The commit message #5 will be skipped:

#	Inline Article.Preview

# The commit message #6 will be skipped:

#	Change type of follow/unfollow buttons a bit.

# The commit message #7 will be skipped:

#	Fix errors decoder

# The commit message #8 will be skipped:

#	Fix login/register redirects

# The commit message #9 will be skipped:

#	Weird bug

# The commit message #10 will be skipped:

#	Remove Debug.logs

# The commit message #1 will be skipped:

#	Fix weird bug

# The commit message #2 will be skipped:

#	Remove Session Internals
@rtfeldman rtfeldman force-pushed the master branch 8 times, most recently from 19cab04 to 7a0ff12 Compare August 27, 2018 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment box does not clear when comment is added
3 participants