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

Change focusAfteropen default value to false #344

Closed
wants to merge 2 commits into from

Conversation

naogify
Copy link
Contributor

@naogify naogify commented Sep 16, 2021

Close #338

Problem

When I set a popup on a marker and click on it, the focus is on the close button (x) and part of the text in the popup is hidden. This happens only when you click on the marker for the first time.

demo.mov

Solution

When I set false to options.focusAfterOpen, it did not happen.

スクリーンショット 2021-09-16 12 04 40

Demo [FocusAfterOpen = false]

https://codepen.io/naogify/pen/dyRZrKo

Test

I run npm run test and this PR passed the tests. But I can't run npm run test-suite because of the error below. I'm glad if someone run the npm run test-suite to test this PR. (I will fix the error later. )

file:///Users/naoppy/naogify/maplibre-gl-js/test/suite_implementation.js:160
                now += operation[1];
                ^

ReferenceError: now is not defined
    at applyOperations (file:///Users/naoppy/naogify/maplibre-gl-js/test/suite_implementation.js:160:17)
    at applyOperations (file:///Users/naoppy/naogify/maplibre-gl-js/test/suite_implementation.js:211:13)
    at Map.<anonymous> (file:///Users/naoppy/naogify/maplibre-gl-js/test/suite_implementation.js:110:9)
    at Map.fire (file:///Users/naoppy/naogify/maplibre-gl-js/rollup/build/tsc/util/evented.js:92:26)
    at Map._render (file:///Users/naoppy/naogify/maplibre-gl-js/rollup/build/tsc/ui/map.js:2002:18)
    at Immediate.<anonymous> (file:///Users/naoppy/naogify/maplibre-gl-js/rollup/build/tsc/ui/map.js:2124:22)
    at processImmediate (internal/timers.js:466:21)

Launch Checklist

  • confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the maplibre-gl-js changelog: <changelog></changelog>

@github-actions
Copy link
Contributor

Bundle size report:

Size Change: 0 B
Total Size Before: 194 kB
Total Size After: 194 kB

Output file Before After Change
maplibre-gl.js 185 kB 185 kB 0 B
maplibre-gl.css 9.49 kB 9.49 kB 0 B
ℹ️ View Details
Source file Before After Change
rollup/build/tsc/ui/popup.js 1.9 kB 1.9 kB +3 B

@HarelM
Copy link
Collaborator

HarelM commented Sep 16, 2021

Can you please a changelog item? Are we sure this is OK with accessibility requirements?

@wipfli
Copy link
Contributor

wipfli commented Sep 16, 2021

Are there any edge cases where the default should better be true?

@HarelM
Copy link
Collaborator

HarelM commented Sep 18, 2021

Accessibility is the only reason I can think of...

@wipfli
Copy link
Contributor

wipfli commented Sep 18, 2021

...which is quite an important one. Actually if we can solve the issue with padding I would prefer it.

@HarelM
Copy link
Collaborator

HarelM commented Sep 18, 2021

@naogify sorry for the confusion, I tend to think now that padding might be the preferred option as opposed to what I wrote earlier. Sorry...

@naogify
Copy link
Contributor Author

naogify commented Sep 18, 2021

@HarelM

Sorry for the late reply. I actually agree with you, I think it's better to add padding-top.

I did some research on accessibility after that, and I think it's important for keyboard users to have the focus on the close button by default. So, I will close this PR! and crate PR of adding padding-top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Part of the text in the popup is hidden by focus of close button.
3 participants