Skip to content

Commit

Permalink
Merge pull request #2663 from NationalSecurityAgency/t#2632/icon-mana…
Browse files Browse the repository at this point in the history
…ger-focus

#2632 Add return focus to icon picker
  • Loading branch information
sudo-may authored Jul 11, 2024
2 parents bd59509 + 114d86c commit dc2186c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ limitations under the License.
import { ref } from 'vue'
import IconManager from '@/components/utils/iconPicker/IconManager.vue'
import OverlayPanel from 'primevue/overlaypanel'
import { useFocusState } from '@/stores/UseFocusState.js'
const focusState = useFocusState()
const emit = defineEmits(['selected-icon'])
const props = defineProps({
Expand All @@ -38,13 +40,13 @@ const props = defineProps({
const iconManagerOverlayPanel = ref()
const toggleIconDisplay = (event) => {
iconManagerOverlayPanel.value.toggle(event)
}
const onSelectedIcon = (selectedIcon) => {
iconManagerOverlayPanel.value.hide()
focusState.focusOnLastElement()
emit('selected-icon', selectedIcon)
}
</script>
Expand All @@ -54,6 +56,7 @@ const onSelectedIcon = (selectedIcon) => {
<SkillsButton
@click="toggleIconDisplay"
outlined
:track-for-focus="true"
class="p-0"
id="iconPicker"
role="button"
Expand Down

0 comments on commit dc2186c

Please sign in to comment.