Skip to content

Instantly share code, notes, and snippets.

@mike-thompson-day8
Last active October 12, 2016 06:10
Show Gist options
  • Save mike-thompson-day8/4e7196d58fb06c040fe6fb235097f395 to your computer and use it in GitHub Desktop.
Save mike-thompson-day8/4e7196d58fb06c040fe6fb235097f395 to your computer and use it in GitHub Desktop.

In re-com v0.10.0, we made changes to the way popover-anchor-wrapper interacts with its :popover child.

These changes are backwards imcompatable and, as a result, you'll probably have to made some light modifications to the components given as the :popover.

Very Simple Change

Typically, popover-context-wrapper is used to create the :popover child of popover-anchor-wrapper, like this:

[popover-anchor-wrapper 
    ... 
    :popover  [popover-context-wrapper 
                 ...]]

The structure of this arrangement stays the same but with the following tweak: you should remove the :position and :showing? parameters from the inner use of popover-context-wrapper. :position and :showing? at this inner level are always duplicates of what is already given in the outer poppver-anchor-wrapper, so this is a nice simplification.

Harder Change

On some occasions, you provide an alternative to popover-context-wrapper

[popover-anchor-wrapper 
    ... 
    :popover  [my-content-wrapper    ;;   <--- not popover-context-wrapper 
                 agr1 arg2 agr3]]          

When you do this, we need to talk about the args which will be suppied to my-content-wrapper. On the surface it looks like only 3 will be supplied arg1, arg2 and arg3. BUT with this new version, be aware that popover-anchor-wrapper will ALSO supply two additional args XXX and YYY

So your

(defn my-content-wrapper 
   [arg1 arg2 arg3 XXX YYY]
   ....)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment