fix firefox behaviour when removing filters and with checkbox filters

This commit is contained in:
pablodip 2018-01-24 09:46:51 +01:00
parent 12edb1abc6
commit 27442937cf
2 changed files with 30 additions and 16 deletions

View File

@ -99,12 +99,15 @@
^{:key (str currency)} ^{:key (str currency)}
[:div.open-bounties-filter-list-option-checkbox [:div.open-bounties-filter-list-option-checkbox
[:label [:label
{:on-click #(rf/dispatch [::handlers/set-open-bounty-filter-type {:on-click #(do (println "label on-click")
::ui-model/bounty-filter-type|currency (rf/dispatch [::handlers/set-open-bounty-filter-type
(cond ::ui-model/bounty-filter-type|currency
(and active? (= #{currency} current-filter-value)) nil (cond
active? (disj current-filter-value currency) (and active? (= #{currency} current-filter-value)) nil
:else (into #{currency} current-filter-value))])} active? (disj current-filter-value currency)
:else (into #{currency} current-filter-value))]))
:tab-index 0
:on-focus #(do (.stopPropagation %) (reset! tooltip-open? true))}
[:input [:input
{:type "checkbox" {:type "checkbox"
:checked active? :checked active?
@ -137,7 +140,9 @@
(cond (cond
(and active? (= #{owner} current-filter-value)) nil (and active? (= #{owner} current-filter-value)) nil
active? (disj current-filter-value owner) active? (disj current-filter-value owner)
:else (into #{owner} current-filter-value))])} :else (into #{owner} current-filter-value))])
:tab-index 0
:on-focus #(do (.stopPropagation %) (reset! tooltip-open? true))}
[:input [:input
{:type "checkbox" {:type "checkbox"
:checked active? :checked active?
@ -159,7 +164,7 @@
:on-focus #(reset! open? true) :on-focus #(reset! open? true)
:on-blur #(reset! open? false)} :on-blur #(reset! open? false)}
[:div.open-bounties-filter-element [:div.open-bounties-filter-element
{:on-mouse-down #(swap! open? not) {:on-mouse-down #(do (println "element on-mouse-down") (swap! open? not))
:class (when (or current-filter-value @open?) :class (when (or current-filter-value @open?)
"open-bounties-filter-element-active")} "open-bounties-filter-element-active")}
[:div.text [:div.text
@ -167,14 +172,15 @@
(ui-model/bounty-filter-value->short-text filter-type current-filter-value) (ui-model/bounty-filter-value->short-text filter-type current-filter-value)
(ui-model/bounty-filter-type->name filter-type))] (ui-model/bounty-filter-type->name filter-type))]
(when current-filter-value (when current-filter-value
[:img.remove [:div.remove-container
{:src "bounty-filter-remove.svg" {:tab-index 0
:tab-index 0 :on-focus #(.stopPropagation %)}
:on-focus #(.stopPropagation %) [:img.remove
:on-mouse-down (fn [e] {:src "bounty-filter-remove.svg"
(.stopPropagation e) :on-mouse-down (fn [e]
(rf/dispatch [::handlers/set-open-bounty-filter-type filter-type nil]) (.stopPropagation e)
(reset! open? false))}])] (rf/dispatch [::handlers/set-open-bounty-filter-type filter-type nil])
(reset! open? false))}]])]
(when @open? (when @open?
[bounties-filter-tooltip [bounties-filter-tooltip
[(tooltip-view-for-filter-type filter-type) current-filter-value open?]])]))) [(tooltip-view-for-filter-type filter-type) current-filter-value open?]])])))

View File

@ -441,6 +441,10 @@
margin: 8px 12px; margin: 8px 12px;
} }
.remove-container {
display: flex;
}
.remove { .remove {
margin-left: -6px; margin-left: -6px;
margin-right: 5px; margin-right: 5px;
@ -618,6 +622,10 @@
cursor: pointer; cursor: pointer;
} }
label:focus {
outline: none;
}
input { input {
background: green; background: green;
transform: scale(1.3); transform: scale(1.3);