How to dynamically adjust the width of a TextField to its content?

I want to make a TextField in SwiftUI that adjusts its width dynamically based on the content, without adding extra spacing.

The TextField is part of an HStack with several Text views, and my goal is to have it appear seamlessly as part of the text. For example, the result should look something like this:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Text("Text(") + Text(""") + TextField + Text(""") + Text(")")
</code>
<code>Text("Text(") + Text(""") + TextField + Text(""") + Text(")") </code>
Text("Text(") + Text(""") + TextField + Text(""") + Text(")")

I tried using the .fixedSize() modifier, which works fine when the text becomes longer. However, it does not shrink the width when the text gets shorter, the TextField retains the initial size.

Here’s a simplified example of what I’ve tried:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import SwiftUI
struct ContentView: View {
@State private var text: String = ""
var body: some View {
HStack(spacing: 0) {
Text("Text(")
Text(""")
TextField("Placeholder", text: $text)
.fixedSize()
.textFieldStyle(PlainTextFieldStyle())
Text(""")
Text(")")
}
.font(.system(size: 15, weight: .medium, design: .monospaced))
}
}
</code>
<code>import SwiftUI struct ContentView: View { @State private var text: String = "" var body: some View { HStack(spacing: 0) { Text("Text(") Text(""") TextField("Placeholder", text: $text) .fixedSize() .textFieldStyle(PlainTextFieldStyle()) Text(""") Text(")") } .font(.system(size: 15, weight: .medium, design: .monospaced)) } } </code>
import SwiftUI

struct ContentView: View {
    @State private var text: String = ""

    var body: some View {
        HStack(spacing: 0) {
            Text("Text(")
            Text(""")
            TextField("Placeholder", text: $text)
                .fixedSize()
                .textFieldStyle(PlainTextFieldStyle())
            Text(""")
            Text(")")
        }
        .font(.system(size: 15, weight: .medium, design: .monospaced))
    }
}

The TextField works fine for longer text, but it doesn’t shrink dynamically when the content becomes shorter than initial one.

Is there a way to have the TextField behave like the Text views, adjusting its width dynamically without leaving extra spacing? Or is manual width calculation the only option?

Any help would be greatly appreciated!

You could show the same text in the background and measure its width using .onGeometryChange. Then apply this width as fixed width to the TextField.

  • Although not apparent from its name, .onGeometryChange also reports the initial size.
  • Apply .fixedSize() to the background version, to allow it to exceed the bounds of its frame.
  • Also apply .hidden(), to prevent it from being seen.
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>@State private var textWidth = CGFloat.zero
</code>
<code>@State private var textWidth = CGFloat.zero </code>
@State private var textWidth = CGFloat.zero
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>TextField("Placeholder", text: $text)
.frame(width: textWidth)
.textFieldStyle(PlainTextFieldStyle())
.background {
Text(text.isEmpty ? "Placeholder" : text)
.fixedSize()
.hidden()
.onGeometryChange(for: CGFloat.self) { proxy in
proxy.size.width
} action: { newVal in
textWidth = newVal
}
}
</code>
<code>TextField("Placeholder", text: $text) .frame(width: textWidth) .textFieldStyle(PlainTextFieldStyle()) .background { Text(text.isEmpty ? "Placeholder" : text) .fixedSize() .hidden() .onGeometryChange(for: CGFloat.self) { proxy in proxy.size.width } action: { newVal in textWidth = newVal } } </code>
TextField("Placeholder", text: $text)
    .frame(width: textWidth)
    .textFieldStyle(PlainTextFieldStyle())
    .background {
        Text(text.isEmpty ? "Placeholder" : text)
            .fixedSize()
            .hidden()
            .onGeometryChange(for: CGFloat.self) { proxy in
                proxy.size.width
            } action: { newVal in
                textWidth = newVal
            }
    }

You might like to wrap the size-reading part as a ViewModifier, to make it more re-usable. The answer to How to get size of child? shows how this can be done (it was my answer).

You might experiment with the fixedSize modifier:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>HStack {
TextField("Prefix", text: $prefix)
.fixedSize()
TextField("Text", text: $text)
.fixedSize()
TextField("Suffix", text: $suffix)
.fixedSize()
}
</code>
<code>HStack { TextField("Prefix", text: $prefix) .fixedSize() TextField("Text", text: $text) .fixedSize() TextField("Suffix", text: $suffix) .fixedSize() } </code>
HStack {
    TextField("Prefix", text: $prefix)
        .fixedSize()
    TextField("Text", text: $text)
        .fixedSize()
    TextField("Suffix", text: $suffix)
        .fixedSize()
}

Possibly combined with constraining the min width:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>HStack {
TextField("Prefix", text: $prefix)
.frame(minWidth: 10, maxWidth: 300)
.fixedSize()
TextField("Text", text: $text)
.fixedSize()
TextField("Suffix", text: $suffix)
.fixedSize()
}
</code>
<code>HStack { TextField("Prefix", text: $prefix) .frame(minWidth: 10, maxWidth: 300) .fixedSize() TextField("Text", text: $text) .fixedSize() TextField("Suffix", text: $suffix) .fixedSize() } </code>
HStack {
    TextField("Prefix", text: $prefix)
        .frame(minWidth: 10, maxWidth: 300)
        .fixedSize()
    TextField("Text", text: $text)
        .fixedSize()
    TextField("Suffix", text: $suffix)
        .fixedSize()
}

Note that the TextField’s width will not shrink smaller than its prompt/placeholder would take.

Update:

This simple solution does not always work correctly: when text has been entered, then this text has been selected, and then deleted, the text field won’t shrink again. It seems to work, when deleting single characters, though. So, we need to investigate this further.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

How to dynamically adjust the width of a TextField to its content?

I want to make a TextField in SwiftUI that adjusts its width dynamically based on the content, without adding extra spacing.

The TextField is part of an HStack with several Text views, and my goal is to have it appear seamlessly as part of the text. For example, the result should look something like this:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Text("Text(") + Text(""") + TextField + Text(""") + Text(")")
</code>
<code>Text("Text(") + Text(""") + TextField + Text(""") + Text(")") </code>
Text("Text(") + Text(""") + TextField + Text(""") + Text(")")

I tried using the .fixedSize() modifier, which works fine when the text becomes longer. However, it does not shrink the width when the text gets shorter, the TextField retains the initial size.

Here’s a simplified example of what I’ve tried:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import SwiftUI
struct ContentView: View {
@State private var text: String = ""
var body: some View {
HStack(spacing: 0) {
Text("Text(")
Text(""")
TextField("Placeholder", text: $text)
.fixedSize()
.textFieldStyle(PlainTextFieldStyle())
Text(""")
Text(")")
}
.font(.system(size: 15, weight: .medium, design: .monospaced))
}
}
</code>
<code>import SwiftUI struct ContentView: View { @State private var text: String = "" var body: some View { HStack(spacing: 0) { Text("Text(") Text(""") TextField("Placeholder", text: $text) .fixedSize() .textFieldStyle(PlainTextFieldStyle()) Text(""") Text(")") } .font(.system(size: 15, weight: .medium, design: .monospaced)) } } </code>
import SwiftUI

struct ContentView: View {
    @State private var text: String = ""

    var body: some View {
        HStack(spacing: 0) {
            Text("Text(")
            Text(""")
            TextField("Placeholder", text: $text)
                .fixedSize()
                .textFieldStyle(PlainTextFieldStyle())
            Text(""")
            Text(")")
        }
        .font(.system(size: 15, weight: .medium, design: .monospaced))
    }
}

The TextField works fine for longer text, but it doesn’t shrink dynamically when the content becomes shorter than initial one.

Is there a way to have the TextField behave like the Text views, adjusting its width dynamically without leaving extra spacing? Or is manual width calculation the only option?

Any help would be greatly appreciated!

You could show the same text in the background and measure its width using .onGeometryChange. Then apply this width as fixed width to the TextField.

  • Although not apparent from its name, .onGeometryChange also reports the initial size.
  • Apply .fixedSize() to the background version, to allow it to exceed the bounds of its frame.
  • Also apply .hidden(), to prevent it from being seen.
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>@State private var textWidth = CGFloat.zero
</code>
<code>@State private var textWidth = CGFloat.zero </code>
@State private var textWidth = CGFloat.zero
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>TextField("Placeholder", text: $text)
.frame(width: textWidth)
.textFieldStyle(PlainTextFieldStyle())
.background {
Text(text.isEmpty ? "Placeholder" : text)
.fixedSize()
.hidden()
.onGeometryChange(for: CGFloat.self) { proxy in
proxy.size.width
} action: { newVal in
textWidth = newVal
}
}
</code>
<code>TextField("Placeholder", text: $text) .frame(width: textWidth) .textFieldStyle(PlainTextFieldStyle()) .background { Text(text.isEmpty ? "Placeholder" : text) .fixedSize() .hidden() .onGeometryChange(for: CGFloat.self) { proxy in proxy.size.width } action: { newVal in textWidth = newVal } } </code>
TextField("Placeholder", text: $text)
    .frame(width: textWidth)
    .textFieldStyle(PlainTextFieldStyle())
    .background {
        Text(text.isEmpty ? "Placeholder" : text)
            .fixedSize()
            .hidden()
            .onGeometryChange(for: CGFloat.self) { proxy in
                proxy.size.width
            } action: { newVal in
                textWidth = newVal
            }
    }

You might like to wrap the size-reading part as a ViewModifier, to make it more re-usable. The answer to How to get size of child? shows how this can be done (it was my answer).

You might experiment with the fixedSize modifier:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>HStack {
TextField("Prefix", text: $prefix)
.fixedSize()
TextField("Text", text: $text)
.fixedSize()
TextField("Suffix", text: $suffix)
.fixedSize()
}
</code>
<code>HStack { TextField("Prefix", text: $prefix) .fixedSize() TextField("Text", text: $text) .fixedSize() TextField("Suffix", text: $suffix) .fixedSize() } </code>
HStack {
    TextField("Prefix", text: $prefix)
        .fixedSize()
    TextField("Text", text: $text)
        .fixedSize()
    TextField("Suffix", text: $suffix)
        .fixedSize()
}

Possibly combined with constraining the min width:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>HStack {
TextField("Prefix", text: $prefix)
.frame(minWidth: 10, maxWidth: 300)
.fixedSize()
TextField("Text", text: $text)
.fixedSize()
TextField("Suffix", text: $suffix)
.fixedSize()
}
</code>
<code>HStack { TextField("Prefix", text: $prefix) .frame(minWidth: 10, maxWidth: 300) .fixedSize() TextField("Text", text: $text) .fixedSize() TextField("Suffix", text: $suffix) .fixedSize() } </code>
HStack {
    TextField("Prefix", text: $prefix)
        .frame(minWidth: 10, maxWidth: 300)
        .fixedSize()
    TextField("Text", text: $text)
        .fixedSize()
    TextField("Suffix", text: $suffix)
        .fixedSize()
}

Note that the TextField’s width will not shrink smaller than its prompt/placeholder would take.

Update:

This simple solution does not always work correctly: when text has been entered, then this text has been selected, and then deleted, the text field won’t shrink again. It seems to work, when deleting single characters, though. So, we need to investigate this further.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

How to dynamically adjust the width of a TextField to its content?

I want to make a TextField in SwiftUI that adjusts its width dynamically based on the content, without adding extra spacing.

The TextField is part of an HStack with several Text views, and my goal is to have it appear seamlessly as part of the text. For example, the result should look something like this:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Text("Text(") + Text(""") + TextField + Text(""") + Text(")")
</code>
<code>Text("Text(") + Text(""") + TextField + Text(""") + Text(")") </code>
Text("Text(") + Text(""") + TextField + Text(""") + Text(")")

I tried using the .fixedSize() modifier, which works fine when the text becomes longer. However, it does not shrink the width when the text gets shorter, the TextField retains the initial size.

Here’s a simplified example of what I’ve tried:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import SwiftUI
struct ContentView: View {
@State private var text: String = ""
var body: some View {
HStack(spacing: 0) {
Text("Text(")
Text(""")
TextField("Placeholder", text: $text)
.fixedSize()
.textFieldStyle(PlainTextFieldStyle())
Text(""")
Text(")")
}
.font(.system(size: 15, weight: .medium, design: .monospaced))
}
}
</code>
<code>import SwiftUI struct ContentView: View { @State private var text: String = "" var body: some View { HStack(spacing: 0) { Text("Text(") Text(""") TextField("Placeholder", text: $text) .fixedSize() .textFieldStyle(PlainTextFieldStyle()) Text(""") Text(")") } .font(.system(size: 15, weight: .medium, design: .monospaced)) } } </code>
import SwiftUI

struct ContentView: View {
    @State private var text: String = ""

    var body: some View {
        HStack(spacing: 0) {
            Text("Text(")
            Text(""")
            TextField("Placeholder", text: $text)
                .fixedSize()
                .textFieldStyle(PlainTextFieldStyle())
            Text(""")
            Text(")")
        }
        .font(.system(size: 15, weight: .medium, design: .monospaced))
    }
}

The TextField works fine for longer text, but it doesn’t shrink dynamically when the content becomes shorter than initial one.

Is there a way to have the TextField behave like the Text views, adjusting its width dynamically without leaving extra spacing? Or is manual width calculation the only option?

Any help would be greatly appreciated!

You could show the same text in the background and measure its width using .onGeometryChange. Then apply this width as fixed width to the TextField.

  • Although not apparent from its name, .onGeometryChange also reports the initial size.
  • Apply .fixedSize() to the background version, to allow it to exceed the bounds of its frame.
  • Also apply .hidden(), to prevent it from being seen.
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>@State private var textWidth = CGFloat.zero
</code>
<code>@State private var textWidth = CGFloat.zero </code>
@State private var textWidth = CGFloat.zero
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>TextField("Placeholder", text: $text)
.frame(width: textWidth)
.textFieldStyle(PlainTextFieldStyle())
.background {
Text(text.isEmpty ? "Placeholder" : text)
.fixedSize()
.hidden()
.onGeometryChange(for: CGFloat.self) { proxy in
proxy.size.width
} action: { newVal in
textWidth = newVal
}
}
</code>
<code>TextField("Placeholder", text: $text) .frame(width: textWidth) .textFieldStyle(PlainTextFieldStyle()) .background { Text(text.isEmpty ? "Placeholder" : text) .fixedSize() .hidden() .onGeometryChange(for: CGFloat.self) { proxy in proxy.size.width } action: { newVal in textWidth = newVal } } </code>
TextField("Placeholder", text: $text)
    .frame(width: textWidth)
    .textFieldStyle(PlainTextFieldStyle())
    .background {
        Text(text.isEmpty ? "Placeholder" : text)
            .fixedSize()
            .hidden()
            .onGeometryChange(for: CGFloat.self) { proxy in
                proxy.size.width
            } action: { newVal in
                textWidth = newVal
            }
    }

You might like to wrap the size-reading part as a ViewModifier, to make it more re-usable. The answer to How to get size of child? shows how this can be done (it was my answer).

You might experiment with the fixedSize modifier:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>HStack {
TextField("Prefix", text: $prefix)
.fixedSize()
TextField("Text", text: $text)
.fixedSize()
TextField("Suffix", text: $suffix)
.fixedSize()
}
</code>
<code>HStack { TextField("Prefix", text: $prefix) .fixedSize() TextField("Text", text: $text) .fixedSize() TextField("Suffix", text: $suffix) .fixedSize() } </code>
HStack {
    TextField("Prefix", text: $prefix)
        .fixedSize()
    TextField("Text", text: $text)
        .fixedSize()
    TextField("Suffix", text: $suffix)
        .fixedSize()
}

Possibly combined with constraining the min width:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>HStack {
TextField("Prefix", text: $prefix)
.frame(minWidth: 10, maxWidth: 300)
.fixedSize()
TextField("Text", text: $text)
.fixedSize()
TextField("Suffix", text: $suffix)
.fixedSize()
}
</code>
<code>HStack { TextField("Prefix", text: $prefix) .frame(minWidth: 10, maxWidth: 300) .fixedSize() TextField("Text", text: $text) .fixedSize() TextField("Suffix", text: $suffix) .fixedSize() } </code>
HStack {
    TextField("Prefix", text: $prefix)
        .frame(minWidth: 10, maxWidth: 300)
        .fixedSize()
    TextField("Text", text: $text)
        .fixedSize()
    TextField("Suffix", text: $suffix)
        .fixedSize()
}

Note that the TextField’s width will not shrink smaller than its prompt/placeholder would take.

Update:

This simple solution does not always work correctly: when text has been entered, then this text has been selected, and then deleted, the text field won’t shrink again. It seems to work, when deleting single characters, though. So, we need to investigate this further.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật