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

Handle key-value pairs pasted as tags #5070

Merged
merged 1 commit into from
Jun 12, 2018

Conversation

AndreasHae
Copy link
Contributor

Implements the behaviour requested in #5024

When a user pastes a string like 'key=value' into the raw tag editor, it gets split into key and value.

@tordans
Copy link
Collaborator

tordans commented Jun 10, 2018

@AndreasHae thanks for this!
I wonder …

  • will this also "submit" the tag or just pre-fill the fields. In later case, the user still has to press enter? Advantage auf auto-submitting is, that the UI shows more details like the (i) icon next to the key-value-pair.
  • where will the cursor/focus be after splitting? Eg at the end of the value-field?
  • what happens if the copied text has new linkes (update 2018-4-16: I meant "new lines", sorry) in it?, eg

key1=value1
key2=value2

(I don't have a dev-environment to test this myself, so I need to ask this way…)

@AndreasHae
Copy link
Contributor Author

@tordans
The tag gets split as soon as the input field loses focus. I am not quite sure what you mean by the other two points, but hopefully this GIF explains the functionality better:
id_key_value_split

@bhousel
Copy link
Member

bhousel commented Jun 12, 2018

Thanks @AndreasHae! I just tried it out and it works great. Hope people find it useful 👍

@bhousel bhousel merged commit 889ea69 into openstreetmap:master Jun 12, 2018
bhousel added a commit that referenced this pull request May 2, 2019
(Reverts: #6211, #5070, #5024)

The old code allows users to circumvent the readonly tag protection
see #6185 (comment)

We'll offer a text-mode instead, with stricter checks on which keys can be modified.
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.

3 participants