Skip to content

Commit

Permalink
Pressing 'Enter' should not insert a new line for direct properties e…
Browse files Browse the repository at this point in the history
…diting (#49)

* Pressing 'Enter' should not inseret a new line for direct properties editing

* Version bump
  • Loading branch information
QubitPi authored Dec 8, 2023
1 parent 36345aa commit 261d3dc
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export function DetailsPane({
<div
suppressContentEditableWarning={true}
contentEditable="true"
onKeyDown={(event: any) => {
if (event.key == 'Enter') {
event.preventDefault() // prevent new line char on Enter (https://stackoverflow.com/a/60008550)
}
}}
onKeyUp={(event: any) => {
if (event.keyCode === 13) {
event.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export function StyleableNodeLabel({
<div
suppressContentEditableWarning={true}
contentEditable="true"
onKeyDown={(event: any) => {
if (event.key == 'Enter') {
event.preventDefault() // prevent new line char on Enter (https://stackoverflow.com/a/60008550)
}
}}
onKeyUp={(event: any) => {
if (event.keyCode === 13) {
event.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ function ExpandableValue({
<div
suppressContentEditableWarning={true}
contentEditable="true"
onKeyDown={(event: any) => {
if (event.key == 'Enter') {
event.preventDefault() // prevent new line char on Enter (https://stackoverflow.com/a/60008550)
}
}}
onKeyUp={(event: any) => {
if (event.keyCode === 13) {
event.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export function DefaultDetailsPane({
<div
suppressContentEditableWarning={true}
contentEditable="true"
onKeyDown={(event: any) => {
if (event.key == 'Enter') {
event.preventDefault() // prevent new line char on Enter (https://stackoverflow.com/a/60008550)
}
}}
onKeyUp={(event: any) => {
if (event.keyCode === 13) {
event.preventDefault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export function RelType({
<div
suppressContentEditableWarning={true}
contentEditable="true"
onKeyDown={(event: any) => {
if (event.key == 'Enter') {
event.preventDefault() // prevent new line char on Enter (https://stackoverflow.com/a/60008550)
}
}}
onKeyUp={(event: any) => {
if (event.keyCode === 13) {
event.preventDefault()
Expand Down
2 changes: 1 addition & 1 deletion src/neo4j-arc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neo4j-devtools-arc",
"version": "0.0.78",
"version": "0.0.79",
"main": "dist/neo4j-arc.js",
"author": "Neo4j Inc.",
"license": "GPL-3.0",
Expand Down

0 comments on commit 261d3dc

Please sign in to comment.