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

Popovers and Tooltips not showin up properly on svg elements #99

Closed
ptzolov opened this issue Jun 10, 2014 · 2 comments
Closed

Popovers and Tooltips not showin up properly on svg elements #99

ptzolov opened this issue Jun 10, 2014 · 2 comments

Comments

@ptzolov
Copy link

ptzolov commented Jun 10, 2014

I'm using this library with om, and the interop is quite nice. The only issue I've come across is is that popovers don't show up centered on the svg element.

example:

(defn offnet-segment
  [app owner]
  (reify
    om/IRenderState
    (render-state [this {:keys [translate scale width control-chan
                                rx ry cursor title data-content]}]
      (dom/g #js {:stroke "black"
                  :transform (str "translate(" translate ") scale(" scale ")")
                  :width width}
             (ReactBootstrap/OverlayTrigger #js {:trigger "click"
                                                 :placement "top"
                                                 :overlay (ReactBootstrap/Popover #js {:title "ID"}
                                                                                  "DESCRIPTION")}
                                            (dom/g nil
                                                   (dom/rect #js {:className "path-element"
                                                                  :x 600
                                                                  :y 120
                                                                  :rx rx
                                                                  :ry ry
                                                                  :width width
                                                                  :height 70
                                                                  :fill "#0c60b7"})
                                                   (dom/text #js {:className "ne-text submit-button"
                                                                  :x (+ 600 (/ width 2))
                                                                  :y 175
                                                                  :fill "white"} "Test")))))))

Example:

The popover should be centred over the svg rectangle.
image

@pieterv
Copy link
Contributor

pieterv commented Jun 11, 2014

Thanks for the issue looks like a bug with our svg support. It seems offsetWidth isn't supported by all browsers on svg elements, looks like we might need to use getComputedStyles to get the width in those cases. See a similar issue: https://github.com/mootools/mootools-core/pull/2602/files.

@ptzolov Awesome to hear react-bootstrap works well with Om, let us know if there is anything we can do Om interop better.

@taion
Copy link
Member

taion commented Jul 24, 2015

Superseded by #1050.

@taion taion closed this as completed Jul 24, 2015
benekastah pushed a commit to benekastah/react-bootstrap that referenced this issue Jul 28, 2015
AustinEast pushed a commit to AustinEast/react-bootstrap that referenced this issue Feb 8, 2017
aryad14 pushed a commit to aryad14/react-bootstrap that referenced this issue Oct 11, 2023
Asserting that the shift key isn't being held down
aryad14 pushed a commit to aryad14/react-bootstrap that referenced this issue Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants