Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

P: SDK: Windows edit field truncates multi-line pasted text

LEGEND ,
Oct 06, 2022 Oct 06, 2022

On Windows, when you paste multi-line text into an osFactory:edit_field with height_in_lines = 1, all but the first line is discarded. But this doesn't happen when you paste more than two lines into an edit field with height_in_lines = 2 -- all the lines are preserved.  Nor does the bad behavior occur on Mac.  The Windows behavior of height_in_lines = 1 is inconsistent with height_in_lines = 2 and with Mac height_in_lines = 1.

 

This bug affects my Any Filter plugin's user interface -- it's important for users to be able to paste in multiple lines of text into an edit_field that for UI design purposes should otherwise be one line high:

johnrellis_0-1665116440142.png

 

The script below illustrates the problem.  I've attached screen recordings of running it on Windows and Mac.

 

 

 

local LrBinding = import "LrBinding"
local LrDialogs = import "LrDialogs"
local LrFunctionContext = import "LrFunctionContext"
local LrView = import "LrView"

local bind = LrView.bind
local f = LrView.osFactory()

LrFunctionContext.callWithContext ("", function (context)
    local prop = LrBinding.makePropertyTable (context)
    local controls = f:column {bind_to_object = prop,
        f:edit_field {height_in_lines = 1, width_in_chars = 10,
            immediate = true, value = bind "text1"},
        f:static_text {height_in_lines = 5, width_in_chars = 10,
            title = bind "text1"},
        f:edit_field {height_in_lines = 2, width_in_chars = 10,
            immediate = true, value = bind "text2"},
        f:static_text {height_in_lines = 5, width_in_chars = 10,
            title = bind "text2"}}

    local result = LrDialogs.presentModalDialog {title = "edit_field bug", 
        contents = controls}
    end)

 

 

 

Bug Fixed
TOPICS
macOS , SDK , Windows
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Pinned Replies

Adobe Employee , Oct 07, 2022 Oct 07, 2022

Update Status for Bug

Status Investigating
Translate
Adobe Employee , Aug 16, 2023 Aug 16, 2023

Greetings all,

 

Updates for the Adobe Photography Products have been released.  The August 2023 updates contain a fix for this issue. 

If you do not see the update in your Creative Cloud Application, you can refresh it by hitting [Ctrl/Cmd]+[Alt/Opt]+[ R ].

Note: It may take up to 24 hours for your update to be available in your Creative Cloud app.

 

Thank you for your patience.

Status Fixed
Translate
9 Comments
Adobe Employee ,
Oct 07, 2022 Oct 07, 2022

Update Status for Bug

Rikk Flohr: Adobe Photography Org
Status Investigating
Translate
Report
Adobe Employee ,
Jun 08, 2023 Jun 08, 2023

@johnrellis 
The team has asked if you can verify this workaround:

 

"A workaround is to have the below values for the edit_field. use_RTF will make the edit_field accept multiline text, and resize_to_fit_text_height will prevent the edit_field from expanding.

use_RTF = true, resize_to_fit_text_height = false"

Rikk Flohr: Adobe Photography Org
Translate
Report
LEGEND ,
Jun 08, 2023 Jun 08, 2023

That works, thanks much.

Translate
Report
LEGEND ,
Jun 08, 2023 Jun 08, 2023

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

The workaround works on Win, but on Mac (where the bug doesn't occur), it stores rich-text-formatted code in the bound value of the edit field, e.g.

 

johnrellis_0-1686243904966.png

 

I don't have access to any Lua code that parses RTF, but this modified workaround works just fine:

 

use_RTF = WIN_ENV, resize_to_fit_text_height = false

 

Translate
Report
Adobe Employee ,
Jun 08, 2023 Jun 08, 2023

I will pass that back to the team.

Rikk Flohr: Adobe Photography Org
Translate
Report
Adobe Employee ,
Aug 16, 2023 Aug 16, 2023

Greetings all,

 

Updates for the Adobe Photography Products have been released.  The August 2023 updates contain a fix for this issue. 

If you do not see the update in your Creative Cloud Application, you can refresh it by hitting [Ctrl/Cmd]+[Alt/Opt]+[ R ].

Note: It may take up to 24 hours for your update to be available in your Creative Cloud app.

 

Thank you for your patience.

Rikk Flohr: Adobe Photography Org
Status Fixed
Translate
Report
LEGEND ,
Aug 17, 2023 Aug 17, 2023

I confirmed that the original test script now runs correctly on both Win and Mac, thanks much.

Translate
Report
LEGEND ,
May 05, 2025 May 05, 2025

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

@Rikk Flohr: Photography, this bug was not completely fixed. Please reopen the bug report. 

 

Pasting multiple lines of text into an edit_field() succeeds on Windows when the regular-sized font is used but still fails when the small-sized font is used.  It works correctly on Mac. 

 

To reproduce, run the script below from within a plugin or using my Debugging Toolkit's Debug Script command. (It won't work from the Scripts folder due to another bug I just reported.)  Copy these four lines of text:

Line 1
Line 2
Line 3
Line 4

and paste them into the four edit_field boxes.   On Mac, the four lines correctly paste into each box:

johnrellis_0-1746505548468.png

 

But on Windows, the last three lines don't paste correctly into the 1-line edit field using the small font:

johnrellis_1-1746505746793.png

 

The workaround provided above by the team appears to work in this case.

 

local LrBinding = import "LrBinding"
local LrDialogs = import "LrDialogs"
local LrFunctionContext = import "LrFunctionContext"
local LrView = import "LrView"

local bind = LrView.bind
local f = LrView.osFactory()

LrFunctionContext.callWithContext ("", function (context)
    local prop = LrBinding.makePropertyTable (context)
    local controls = f:column {bind_to_object = prop, 
        f:row {
            f:column {size = "small",
                f:static_text {title = "Small 1-line:"},
                f:edit_field {height_in_lines = 1, width_in_chars = 10,
                    immediate = true, value = bind "text1",
                    use_RTF = WIN_ENV, resize_to_fit_text_height = false},
                f:static_text {height_in_lines = 5, width_in_chars = 10,
                    title = bind "text1"}},
            f:column {size = "regular",
                f:static_text {title = "Regular 1-line:"},
                f:edit_field {height_in_lines = 1, width_in_chars = 10,
                    immediate = true, value = bind "text2"},
                f:static_text {height_in_lines = 5, width_in_chars = 10,
                    title = bind "text2"}}},
        f:row {
            f:column {size = "small",
                f:static_text {title = "Small 2-line:"},
                f:edit_field {height_in_lines = 2, width_in_chars = 10,
                    immediate = true, value = bind "text3"},
                f:static_text {height_in_lines = 5, width_in_chars = 10,
                    title = bind "text3"}},
            f:column {size = "regular",
                f:static_text {title = "Regular 2-line:"},
                f:edit_field {height_in_lines = 2, width_in_chars = 10,
                    immediate = true, value = bind "text4"},
                f:static_text {height_in_lines = 5, width_in_chars = 10,
                    title = bind "text4"}}}}
    local result = LrDialogs.presentModalDialog {title = "edit_field bug", 
        contents = controls}
    end)

 

Translate
Report
Adobe Employee ,
May 06, 2025 May 06, 2025
LATEST

@johnrellis 

 

I've forwarded your post to the team and asked them to review in the context of the previous bug. We will wait for their direction. 

 

Rikk Flohr: Adobe Photography Org
Translate
Report