-
-
Notifications
You must be signed in to change notification settings - Fork 18
Modified the input control to also respond to losing / gaining the focus #64
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
Modified the input control to also respond to losing / gaining the focus #64
Conversation
| (send the-field set-field-background background-color)) | ||
| (begin0 the-field | ||
| (send the-field set-context 'last-val content))) | ||
| (send the-field set-context 'last-val content))) |
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.
Meta note: I think you've formatted a bunch of code that didn't need to be touched
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.
Ah, hate it when that happens. :/
Is there a particular linting set of rules I could use to avoid these problems?
I mostly use drracket but otherwise a neovim user.
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.
I'm not sure: I might have configured begin0 to indent correctly recently, but I'm not sure about case/dep.
Depending on the (Neo)Vim plugins you use, it might be as simple as adding those forms to lispwords.
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.
In DrRacket, you can add begin0 and case/dep to "Preferences" -> "Editing" -> "Define-like Keywords".
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.
I just checked, and if you're using my vim-racket, both forms should already be configured correctly for indentation. They should also be in lispwords if you have a recent-ish Vim (since I contribute some parts of that plugin back to upstream runtime files occasionally). Vim users (but not Neovim, sorry) also benefit from the indentexpr I wrote that correctly handles for and for/fold forms, FWIW.
Bogdanp
left a comment
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.
Looks good, thanks! If you fixup the indentation problems and rebase, I'll go ahead and merge.
|
Rebased and merged locally. Thanks! |
This PR proposes an intermediate solution to the way observable based views update their content once their observable has been updated.
Currently, observable based views completely recreate their content once their observable gets updated to reflect the new data values. This creates the interesting behaviour, where, when a view's controls update the view's observable, they get re-created and this means that an input control would lose focus. For example (try to edit the text in either of these boxes):
This PR adds two more events in the
inputcontrol'saction,has-focusandlost-focus. This does not change the updating behaviour of a given observable based view but makes the "re-creation" invisible because most of the times, the user has finished editing text in a given text box.Compare the previous behaviour of the "Value - A"
inputto: