egOrgSelector's notion of a change event is eccentric

Bug #1685356 reported by Galen Charlton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Wishlist
Unassigned

Bug Description

As a result of commit 354988bf from bug 1642378, an onchange handler associated with an egOrgSelector is also called when the egOrgSelector is initialized... which means that a handler expecting a _change_ of value won't do the right thing. One consequence of this is that one can't do this to allow using an egOrgSelector to mark a form as dirty:

<eg-org-selector onchange="form.$setDirty()"...

It would be helpful if we could fix this so that onchange has more typical semantics (e.g., https://developer.mozilla.org/en-US/docs/Web/Events/change). Note that the notion of having uib-dropdown participate in form validation was shot down by the Angular maintainers: https://github.com/angular-ui/bootstrap/issues/5088

Evergreen master

Tags: angular
Galen Charlton (gmc)
Changed in evergreen:
milestone: none → 3.0-alpha
tags: added: webstaffclient
Revision history for this message
Bill Erickson (berick) wrote :

Should a sticky value, applied at page load time, fire the on-change?

Revision history for this message
Galen Charlton (gmc) wrote :

Noting some discussion on IRC today:

<gmcharlt> berick: thinking aloud re bug 1685356 - it occurred to me that maybe we should split egOrgSelector into two directives
<pinesol_green> Launchpad bug 1685356 in Evergreen "egOrgSelector's notion of a change event is eccentric " [Undecided,New] https://launchpad.net/bugs/1685356
<gmcharlt> with egOrgSelector itself having its purpose narrowed to being a widget that you use to select an OU and have something happen (e.g., change a grid's filter or the like)
<gmcharlt> and create a new egOrgInput that is meant to be used in forms and is based on select rather than uib-dropdown
<berick> gmcharlt: so if we have a select-based org picker that works well with forms, any reason not to just use that everywhere?
<berick> trying to understand what each provides
<gmcharlt> berick: in the short term, an easier transition
<berick> OK so goal may be to deprecate egOrgSelector, but time will tell?
<gmcharlt> in the long run, there may not be much reason to have two, beyond a possible use case of wanting to have an OU selector in the form that manipulates the form display without marking the form as dirty
<gmcharlt> ^^ I'm stretching here, of course
<berick> right
<berick> could also be a toggle/setting
<berick> having something play nice w/ forms without a lot of hackery seems like a reasonable goal
<gmcharlt> OK; I'll run with it under the name egOrgInput; once I've got something working, we can evaluate where it fits overall
-*- berick nods

Revision history for this message
Bill Erickson (berick) wrote :

And let's not forget the code from bug #1511742 which replaces the egOrgSelector uib-dropdown with a uib-typeahead text input. Any chance that's the magic sauce this needs?

Revision history for this message
Galen Charlton (gmc) wrote :

It may well help, as it looks like uib-typeahead is ngForm-aware.

Changed in evergreen:
milestone: 3.0-beta → 3.next
importance: Undecided → Wishlist
tags: added: angular
removed: webstaffclient
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.