microsoft / microsoft/fluentui-apple

MSFNavigationBar does not update the title on the same instance unless titleView is reset.

Open
#1,968 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
977
Forks
180
Avg merge
21h 38m
Merged PRs (30d)
1

Description

MSFNavigationBar does not update the title on the same instance unless titleView is reset.
NavigationBar.Swift :: updateSubtitleView, it checks for navigationItem.titleView == nil and returns without setting navigationItem.titleView = customTitleView.

So without setting viewController.navigationItem.titleView to nil, the following code will not update the navbar title on the same instance of viewController if it was run once before.

viewController.title = "My Custom Title"
navigationController?.pushViewController(viewController, animated: true)

Please look into fixing this. If this is there for a reason for this behaviuor, please expose an API that allows to set navbar title without having set viewController.navigationItem.titleView = nil

Environment Information
  • Platform:
    • [ x] iOS
    • macOS
Please provide a reproduction of the bug:

Explained above.

Priorities and help requested:

Are you willing to submit a PR to fix? (Yes, No)
No

Requested priority: (Blocking, High, Normal, Low)
Low

Products/applications affected: (if applicable)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in NavigationBar.Swift, at updateSubtitleView, and reproduce the issue by reusing the same view controller with different titles. The work is done when the navigation bar title updates on the same instance without manually resetting navigationItem.titleView.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.