When clicking an inactive feature in direct_select, select it#978
Open
trygveaa wants to merge 1 commit intomapbox:mainfrom
Open
When clicking an inactive feature in direct_select, select it#978trygveaa wants to merge 1 commit intomapbox:mainfrom
trygveaa wants to merge 1 commit intomapbox:mainfrom
Conversation
|
Good ! But cursor pointer (hover) on inactive feature is missing @trygveaa |
3aa2ab3 to
0d091e1
Compare
Author
|
@usb248: Ah, right. I fixed it now. |
0d091e1 to
7acd0b7
Compare
Contributor
adrianababakanian
left a comment
There was a problem hiding this comment.
Thanks for opening @trygveaa -- this is working well. I'd advise a small update to the test case before merging.
Comment on lines
283
to
292
| afterNextRender(() => { | ||
| click(map, makeMouseEvent(clickAt[0], clickAt[1])); | ||
| afterNextRender(() => { | ||
| t.equal(Draw.getSelectedIds().indexOf(polygonId) !== -1, true, 'polygon is now selected'); | ||
| cleanUp(() => st.end()); | ||
| }); | ||
| }); |
Contributor
There was a problem hiding this comment.
Since a selection change is occurring, it is worth checking that the correct event is fired.
Suggested change
| afterNextRender(() => { | |
| click(map, makeMouseEvent(clickAt[0], clickAt[1])); | |
| afterNextRender(() => { | |
| t.equal(Draw.getSelectedIds().indexOf(polygonId) !== -1, true, 'polygon is now selected'); | |
| cleanUp(() => st.end()); | |
| }); | |
| }); | |
| afterNextRender(() => { | |
| click(map, makeMouseEvent(clickAt[0], clickAt[1])); | |
| map.fire.resetHistory(); | |
| afterNextRender(() => { | |
| const args = getFireArgs().filter(arg => arg[0] === 'draw.selectionchange'); | |
| t.equal(args.length, 1, 'should have one and only one selectionchange event'); | |
| t.equal(Draw.getSelectedIds().indexOf(polygonId) !== -1, true, 'polygon is now selected'); | |
| cleanUp(() => st.end()); | |
| }); | |
| }); |
With this, you don't have to click twice to select another feature when you are in direct_select. The mode will still be changed to simple_select. So if you want to activate direct_select for another feature, you have to click it twice, but that's still one less click than before.
00bc6a4 to
aec298f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this, you don't have to click twice to select another feature when
you are in direct_select.
The mode will still be changed to simple_select. So if you want to
activate direct_select for another feature, you have to click it twice,
but that's still one less click than before.