-
Notifications
You must be signed in to change notification settings - Fork 592
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
When clicking an inactive feature in direct_select, select it #978
base: main
Are you sure you want to change the base?
When clicking an inactive feature in direct_select, select it #978
Conversation
Good ! But cursor pointer (hover) on inactive feature is missing @trygveaa |
3aa2ab3
to
0d091e1
Compare
@usb248: Ah, right. I fixed it now. |
0d091e1
to
7acd0b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening @trygveaa -- this is working well. I'd advise a small update to the test case before merging.
test/direct_select.test.js
Outdated
afterNextRender(() => { | ||
click(map, makeMouseEvent(clickAt[0], clickAt[1])); | ||
afterNextRender(() => { | ||
t.equal(Draw.getSelectedIds().indexOf(polygonId) !== -1, true, 'polygon is now selected'); | ||
cleanUp(() => st.end()); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since a selection change is occurring, it is worth checking that the correct event is fired.
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()); | |
}); | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, applied.
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
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.